SECURITY: do not allow tags in math wrapper

This commit is contained in:
Sam 2018-08-17 16:14:27 +10:00
parent 28162e9ded
commit fd5258cb3c
1 changed files with 2 additions and 2 deletions

View File

@ -52,14 +52,14 @@ function decorate(elem, isPreview) {
`<${tag} style="display: none;"><script type="math/tex${display}"></script></${tag}>` `<${tag} style="display: none;"><script type="math/tex${display}"></script></${tag}>`
); );
$math = $mathWrapper.children(); $math = $mathWrapper.children();
$math.html($elem.text()); $math.text($elem.text());
$elem.after($mathWrapper); $elem.after($mathWrapper);
} else if ($elem.hasClass("asciimath")) { } else if ($elem.hasClass("asciimath")) {
$mathWrapper = $( $mathWrapper = $(
`<span style="display: none;"><script type="math/asciimath"></script></span>` `<span style="display: none;"><script type="math/asciimath"></script></span>`
); );
$math = $mathWrapper.children(); $math = $mathWrapper.children();
$math.html($elem.text()); $math.text($elem.text());
$elem.after($mathWrapper); $elem.after($mathWrapper);
} }