Commit graph

17 commits

Author SHA1 Message Date
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
Steven
e8ed437ca3 fix: purify html before render 2024-06-04 23:10:54 +08:00
Steven
584c669068 chore: tweak max width 2024-05-09 22:10:27 +08:00
Steven
d8aeec993c chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
Dubzer
8ee56bd29f
feat: add code wrapping option on mobile devices (#3196)
* feat: add code wrapping option on mobile devices

* Minor changes

* oopsie
2024-04-10 22:03:47 +08:00
Steven
7d5f603482 chore: update compact view 2024-03-04 11:21:48 +08:00
Steven
4378816e44 chore: tweak i18n 2024-02-21 23:02:18 +08:00
Kristián
03d67d5a00
feat: add mermaid support in codeblock (#2971) 2024-02-19 15:10:58 +08:00
Steven
a76b86f18a chore: fix highlight code 2024-02-06 20:59:17 +08:00
Steven
c522e1450a chore: update codeblock style 2024-02-01 21:38:28 +08:00
Steven
8ce6a32aac feat: use gomark wasm in frontend 2024-01-31 22:25:24 +08:00
Steven
8c6292925e chore: update code block styles 2024-01-28 15:41:11 +08:00
Steven
932f636d84 chore: update codeblock renderer 2024-01-27 19:09:10 +08:00
Mark Zhao
bd1cf62761
feat: enable iframe rendering in markdown code block (#2799)
* enable iframe rendering in code block

* fix eslint issue
2024-01-20 11:36:45 +08:00
Steven
f563b58a85 chore: fix renderer props 2024-01-05 08:47:43 +08:00
Steven
96140f3875 chore: tweak dark mode styles 2024-01-03 23:12:50 +08:00
Steven
a3feeceace chore: remove component v1 suffix 2023-12-22 08:29:02 +08:00
Renamed from web/src/components/MemoContentV1/CodeBlock.tsx (Browse further)