This commit is contained in:
Vanessa 2022-09-15 23:05:18 +08:00
parent 0285730c59
commit 8d8f2b9910
2 changed files with 13 additions and 10 deletions

View file

@ -66,9 +66,15 @@ export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWid
}
} else {
if (blockElement && mathElement.getBoundingClientRect().width > blockElement.clientWidth) {
mathElement.setAttribute("style", "max-width:100%;overflow-x:auto;overflow-y:hidden;display:inline-block");
mathElement.style.maxWidth = "100%"
mathElement.style.overflowX = "auto"
mathElement.style.overflowY = "hidden"
mathElement.style.display = "inline-block"
} else {
mathElement.removeAttribute("style");
mathElement.style.maxWidth = ""
mathElement.style.overflowX = ""
mathElement.style.overflowY = ""
mathElement.style.display = ""
}
const nextSibling = hasNextSibling(mathElement);
if (!nextSibling) {