Vanessa 2025-07-01 21:42:20 +08:00
parent 8b1a2d49d7
commit 3595312920

View file

@ -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);