diff --git a/packages/viewer/src/mathml.ts b/packages/viewer/src/mathml.ts index 7f5344df7..8e3bbf5cf 100644 --- a/packages/viewer/src/mathml.ts +++ b/packages/viewer/src/mathml.ts @@ -19,7 +19,7 @@ interface FormulaData { */ function findSafeMathMLTextNodes(root: HTMLElement): Node[] { const nodeIterator: NodeIterator = document.createNodeIterator(root, NodeFilter.SHOW_TEXT, (node) => - /«math(.*?)«\/math»/g.test(node.nodeValue || "") ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT, + /«math([\s\S]*?)«\/math»/g.test(node.nodeValue || "") ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT, ); const safeNodes: Node[] = [];