commit 142857afa2ca5854f72c3955f1676660c79b2e72
parent 7b5596fd4a8577b9ae87026ca35a4a37dff3865c
Author: Davide P. Cervone <dpvc@union.edu>
Date: Thu, 20 Nov 2014 09:35:56 -0500
Remove unneeded grouping from regular expression (performance improvement)
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js
@@ -160,7 +160,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
if (annotation) {
if (nested) {data.unshift(space+" <mrow>"); data.push(space+" </mrow>")}
data.unshift(space+" <semantics>");
- var xmlEscapedTex = jax.originalText.replace(/([&<>])/g, function(item) {
+ var xmlEscapedTex = jax.originalText.replace(/[&<>]/g, function(item) {
return { '>': '>', '<': '<','&': '&' }[item]
});
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");