• andrigamerita's avatar
    fix: code blocks of unknown languages cause HTML injection (#3711) · d264f459
    andrigamerita authored
    * fix: code blocks of unknown languages cause HTML injection
    
    A code block of unknown language (that is, a language not treated as special by Memos and not handled by highlight.js) should fall back on rendering its plaintext content. However, the content is never properly escaped before it is appended to the DOM, and thus any string that happens to contain HTML is unsafely rendered. This commit fixes the issue by ensuring that, when none of the previous cases handle the text, any HTML entities are escaped first.
    
    * Update CodeBlock.tsx to conform to eslint
    d264f459
Name
Last commit
Last update
..
components Loading commit data...
css Loading commit data...
helpers Loading commit data...
hooks Loading commit data...
layouts Loading commit data...
less Loading commit data...
locales Loading commit data...
pages Loading commit data...
router Loading commit data...
store Loading commit data...
theme Loading commit data...
types Loading commit data...
utils Loading commit data...
App.tsx Loading commit data...
grpcweb.ts Loading commit data...
i18n.ts Loading commit data...
main.tsx Loading commit data...