XML-escape TeX annotation
This commit is contained in:
parent
9cefee80f9
commit
c526b2a5c5
|
@ -160,7 +160,10 @@ 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>");
|
||||
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>");
|
||||
}
|
||||
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";
|
||||
|
|
Loading…
Reference in New Issue
Block a user