mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
This commit is contained in:
parent
8b1a2d49d7
commit
3595312920
1 changed files with 10 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue