🏁 pre-process list tag li

This commit is contained in:
Sahatsawat Kanpai 2025-01-22 15:02:22 +07:00
parent 28eddb8fc0
commit 25ac23c3ae

View File

@ -90,6 +90,21 @@ export default class Import extends Plugin {
span.setAttribute("style", `${span.getAttribute("style")}; font-size: ${fontSize}`); span.setAttribute("style", `${span.getAttribute("style")}; font-size: ${fontSize}`);
} }
} }
const li = span.parentElement;
if (li && li.tagName === "LI") {
const fontSize = li.style.fontSize;
if (fontSize) {
span.setAttribute("style", `${span.getAttribute("style")}; font-size: ${fontSize}`);
}
}
const pp = span.parentElement?.parentElement;
if (pp && span.parentElement.tagName === "A") {
const fontSize = pp.style.fontSize;
if (fontSize) {
span.setAttribute("style", `${span.getAttribute("style")}; font-size: ${fontSize}`);
console.log("OwOUwU");
}
}
}); });
console.log("Converted HTML:", body.innerHTML); console.log("Converted HTML:", body.innerHTML);
this.editor.setData(body.innerHTML); this.editor.setData(body.innerHTML);