memos/web/src
andrigamerita d264f45979
fix: code blocks of unknown languages cause HTML injection (#3711)
* 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
2024-07-19 08:32:58 +08:00
..
components fix: code blocks of unknown languages cause HTML injection (#3711) 2024-07-19 08:32:58 +08:00
css chore: use popover for update tag view setting 2024-07-17 08:46:52 +08:00
helpers chore: retire storage related functions 2024-04-28 21:50:09 +08:00
hooks feat: add hook for generating different date times (#3524) 2024-06-05 19:52:07 +08:00
layouts feat: add more memo settings 2024-05-29 23:17:53 +08:00
less chore: retire share dialog 2024-05-13 07:57:58 +08:00
locales chore: update i18n from Weblate (#3680) 2024-07-12 22:22:59 +08:00
pages feat: implement inline memo editor 2024-07-17 21:07:36 +08:00
router chore: tweak root redirector 2024-05-28 19:59:29 +08:00
store feat(api): implement get resource by uid 2024-07-11 23:43:44 +08:00
theme chore: update resource dialog style (#982) 2023-01-21 08:46:49 +08:00
types chore: remove external resource dialog 2024-04-29 22:57:47 +08:00
utils chore: use popover for update tag view setting 2024-07-17 08:46:52 +08:00
App.tsx chore: tweak naming 2024-05-13 20:03:04 +08:00
grpcweb.ts refactor: update memo tags 2024-05-08 20:03:01 +08:00
i18n.ts chore: add th locale 2024-06-09 07:46:03 +08:00
main.tsx refactor: add markdown service 2024-04-29 08:00:37 +08:00