Skip to content

Commit 7a00695

Browse files
committed
Remove spaces from tag IDs, but allow other characters (since they are legal in HTML5) and use encodeURIComponent() rather than encode(). People who want to filter more characters can override this funciton in their own configurations. Resolves issue #1899.
1 parent af09e53 commit 7a00695

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unpacked/jax/input/TeX/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ MathJax.InputJax.TeX = MathJax.InputJax({
4141
// or "all" for all displayed equations
4242
formatNumber: function (n) {return n},
4343
formatTag: function (n) {return '('+n+')'},
44-
formatID: function (n) {return 'mjx-eqn-'+String(n).replace(/[:"'<>&]/g,"")},
45-
formatURL: function (id,base) {return base+'#'+escape(id)},
44+
formatID: function (n) {return 'mjx-eqn-'+String(n).replace(/\s/g,"_")},
45+
formatURL: function (id,base) {return base+'#'+escapeURIComponent(id)},
4646
useLabelIds: true
4747
}
4848
},

0 commit comments

Comments
 (0)