From 142857afa2ca5854f72c3955f1676660c79b2e72 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 20 Nov 2014 09:35:56 -0500 Subject: [PATCH] Remove unneeded grouping from regular expression (performance improvement) --- unpacked/extensions/toMathML.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js index 8ea82e383..28135c383 100644 --- 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+" "); data.push(space+" ")} data.unshift(space+" "); - var xmlEscapedTex = jax.originalText.replace(/([&<>])/g, function(item) { + var xmlEscapedTex = jax.originalText.replace(/[&<>]/g, function(item) { return { '>': '>', '<': '<','&': '&' }[item] }); data.push(space+' '+xmlEscapedTex+"");