Merge pull request #959 from physikerwelt/TeXML
XML-escape TeX annotation (Resolves issue #935)
This commit is contained in:
commit
7b5596fd4a
|
@ -160,7 +160,10 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
||||||
if (annotation) {
|
if (annotation) {
|
||||||
if (nested) {data.unshift(space+" <mrow>"); data.push(space+" </mrow>")}
|
if (nested) {data.unshift(space+" <mrow>"); data.push(space+" </mrow>")}
|
||||||
data.unshift(space+" <semantics>");
|
data.unshift(space+" <semantics>");
|
||||||
data.push(space+' <annotation encoding="'+annotation+'">'+jax.originalText+"</annotation>");
|
var xmlEscapedTex = jax.originalText.replace(/([&<>])/g, function(item) {
|
||||||
|
return { '>': '>', '<': '<','&': '&' }[item]
|
||||||
|
});
|
||||||
|
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");
|
||||||
data.push(space+" </semantics>");
|
data.push(space+" </semantics>");
|
||||||
}
|
}
|
||||||
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";
|
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user