www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d8b99effa0654a51689bc0977bbeda65badb6daa
parent 96dc4b2b2a71d3a66e295830f67dea4734b69153
Author: Frédéric Wang <fred.wang@free.fr>
Date:   Sat, 22 Dec 2012 21:30:14 +0100

Follow suggestions from Davide's review comment.

Diffstat:
Munpacked/extensions/toMathML.js | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js @@ -122,10 +122,14 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () { // Code points U+10000 to U+10FFFF. // n is the lead surrogate, let's read the trail surrogate. var trailSurrogate = string[i+1].charCodeAt(0); - var codePoint = (((n-0xD800)*0x400)+(trailSurrogate-0xDC00)+0x10000); + var codePoint = (((n-0xD800)<<10)+(trailSurrogate-0xDC00)+0x10000); string[i] = "&#x"+codePoint.toString(16).toUpperCase()+";"; string[i+1] = ""; i++; + } else { + // n is a lead surrogate without corresponding trail surrogate: + // remove that character. + string[i] = ""; } } return string.join("");