Repository navigation
Commit 10ec183
fix(frontend): make inline code readable under default 'auto' syntax theme
The inline code `<code>` fallback in MarkdownCode looked up the active
syntax highlighter theme directly in SYNTAX_HIGHLIGHTER_THEMES, which
has no entry for the default value 'auto'. The lookup returned
undefined, so color fell through to '#fff' (white) and background to
undefined (transparent), making inline code and fenced code blocks
without a language unreadable on light backgrounds.
Resolve 'auto' to the effective theme value ('vs' in light mode,
'atomDark' in dark mode) before the metadata lookup, and fall back to
'atomDark' for unknown values so color/background stay consistent.
Fixes #749
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 5c680e8 commit 10ec183
3 files changed
Lines changed: 22 additions & 15 deletions
File tree
- packages/frontend
- src
- components/Content/MarkdownContent/MarkdownRenderer
- hooks
- test/unit/components/Content/MarkdownContent/MarkdownRenderer/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
| |||
94 | 109 | | |
95 | 110 | | |
96 | 111 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 112 | + | |
| 113 | + | |
105 | 114 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments