Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:recycle: https://github.com/siyuan-note/siyuan/pull/15138

Vanessa3595312920f5
diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.ts
index c3c1196494..013fd3bb1f 100644
--- a/app/src/protyle/preview/index.ts
+++ b/app/src/protyle/preview/index.ts
@@ -235,22 +235,18 @@ export class Preview {
});
});
// 处理任务列表(微信公众号不能显示input[type="checkbox"])
- copyElement.querySelectorAll('li.protyle-task').forEach(taskItem => {
- // Set checkbox input opacity to 0
- const checkbox = taskItem.querySelector('input[type="checkbox"]');
+ copyElement.querySelectorAll("li.protyle-task").forEach((taskItem: HTMLElement) => {
+ const checkbox = taskItem.querySelector('input[type="checkbox"]') as HTMLInputElement;
if (checkbox) {
- checkbox.style.opacity = '0';
- }
-
- const isDone = taskItem.classList.contains('protyle-task--done');
- if (isDone) {
- taskItem.style.setProperty('list-style-type', "'✅'", 'important');
- }
- else {
- taskItem.style.setProperty('list-style-type', "'▢'", 'important');
+ checkbox.style.opacity = "0";
+ if (checkbox.checked) {
+ taskItem.style.setProperty("list-style-type", "'✅'", "important");
+ } else {
+ taskItem.style.setProperty("list-style-type", "'▢'", "important");
+ }
}
});
- if(typeof window.MathJax === "undefined") {
+ if (typeof window.MathJax === "undefined") {
window.MathJax = {
svg: {
fontCache: "none"
@@ -262,7 +258,7 @@ export class Preview {
copyElement.querySelectorAll('[data-subtype="math"]').forEach(mathElement => {
const node = window.MathJax.tex2svg(Lute.UnEscapeHTMLStr(mathElement.getAttribute("data-content")).trim(), {display: mathElement.tagName === "DIV"});
node.querySelector("mjx-assistive-mml").remove();
- mathElement.innerHTML= node.outerHTML;
+ mathElement.innerHTML = node.outerHTML;
});
} else if (type === "zhihu") {
this.link2online(copyElement);