Skip to content

Commit 177c8cc

Browse files
committed
Only make a new node in the map when there isn't one already
1 parent b89d216 commit 177c8cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mathjax3-ts/output/common/OutputJax.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ AbstractOutputJax<N, T, D> {
266266
for (const math of html.math) {
267267
const node = adaptor.parent(math.start.node);
268268
const map = domMaps[math.display? 1 : 0];
269-
map.set(node, this.getTestElement(node, math.display));
269+
if (!map.has(node)) {
270+
map.set(node, this.getTestElement(node, math.display));
271+
}
270272
}
271273
//
272274
// Measure the metrics for all the mapped elements

0 commit comments

Comments
 (0)