• Robert Knight's avatar
    Avoid sanitizing HTML generated by KaTeX. · 166b60fa
    Robert Knight authored
    KaTeX escapes its own input and we trust it to generate safe HTML as
    output. Passing HTML generated by KaTeX through ngSanitize can mangle
    the result.  eg. The formatting of the infinity symbol is corrupted when
    using this test block for example:
    
      $$\lim_{x \to \infty} \exp(-x) = 0$$
    
    This commit rewrites the rendering logic to only sanitize the markdown
    output from Showdown.
    
    This additionally fixes an issue where text that _happened_ to also
    be valid markdown in the rendered math would be rendered as markdown,
    which is not what we want.
    166b60fa
render-markdown.js 3.81 KB