Skip to content

Commit cd0b88e

Browse files
committed
Don't let nesting count go below zero. Resolves issue #523.
1 parent 02261ae commit cd0b88e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

unpacked/jax/output/HTML-CSS/autoload/multiline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
542542
// mrows for nesting, but can leave these unbalanced.
543543
//
544544
if (values.texClass === MML.TEXCLASS.OPEN) {info.nest++}
545-
if (values.texClass === MML.TEXCLASS.CLOSE) {info.nest--}
545+
if (values.texClass === MML.TEXCLASS.CLOSE && info.nest) {info.nest--}
546546
//
547547
// Get the default penalty for this location
548548
//

unpacked/jax/output/SVG/autoload/multiline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
490490
// mrows for nesting, but can leave these unbalanced.
491491
//
492492
if (values.texClass === MML.TEXCLASS.OPEN) {info.nest++}
493-
if (values.texClass === MML.TEXCLASS.CLOSE) {info.nest--}
493+
if (values.texClass === MML.TEXCLASS.CLOSE && info.nest) {info.nest--}
494494
//
495495
// Get the default penalty for this location
496496
//

0 commit comments

Comments
 (0)