Commit Graph

36 Commits

Author SHA1 Message Date
Steven f44b0850f4 feat: enhance CodeBlock component with theme-aware syntax highlighting 2025-09-16 19:08:28 +08:00
Steven 383553d3c8 feat: add DOMPurify for sanitizing HTML content in CodeBlock component 2025-09-10 20:52:51 +08:00
Johnny e93f3cbb8b refactor: unify theme and apperance 2025-08-17 11:27:59 +08:00
Steven d7ced7b738 fix: code block style in dark mode 2025-07-18 19:25:29 +08:00
Maximilian Krauß c4baba8527
fix(syntax-highlighting): adds missing CSS imports to CodeBlock.tsx (#4890) 2025-07-17 21:23:42 +08:00
Johnny 35928ce5ba chore: unify colors 2025-07-06 13:55:08 +08:00
Johnny a3de61a141 chore: fix dark mode 2025-07-05 11:40:49 +08:00
Johnny db4b1f5fde chore: tweak styles 2025-07-05 11:26:59 +08:00
Johnny 91be2f68d1
feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
Johnny 493832aeb4 refactor: unify components 2025-07-01 19:29:48 +08:00
Johnny f5c64849d2 chore: upgrade tailwindcss to v4 2025-06-07 10:15:12 +08:00
Steven 72babbb393 fix: dark mode of highlight.js 2025-05-20 23:58:22 +08:00
Johnny b770042a8a refactor: migrate eslint 2025-04-01 00:04:43 +08:00
Johnny 09c50a8419 fix: codeblock highlight 2025-03-30 23:49:51 +08:00
johnnyjoy 0b85cb567e chore(frontend): fix clsx 2025-02-01 22:04:29 +08:00
Steven 67c1a46346 chore: remove html renderer sanitizes 2024-11-05 22:44:37 +08:00
Steven c4b52c68b5 fix: max height of memo content compact mode 2024-10-15 20:07:55 +08:00
ti777777 6f3d5762ca
fix: iframe rendering (#3916)
* fix iframe rendering

* fix eslint check
2024-09-12 08:54:33 +08:00
Michel Heusschen 2dbf92f7f1
perf: reduce bundle size by 21% with direct icon imports (#3844) 2024-08-28 22:55:28 +08:00
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)