Private
Public Access
0
0

feat(markdown): apply active theme syntax palette to code blocks

This commit is contained in:
2026-06-04 23:13:33 -04:00
parent df2e82a82d
commit 1cb68e4e3f
2 changed files with 32 additions and 0 deletions
+7
View File
@@ -73,6 +73,13 @@ class MarkdownRenderer:
# Optional callback for custom local link handling (e.g., opening in IDE)
self.on_local_link: Optional[Callable[[str], None]] = None
# Apply the current theme's syntax palette on construction so new
# editors we create pick up the right colors. The renderer is re-created
# when the theme changes (see theme_2 module-load behavior).
from src import theme_2
palette_id = theme_2.get_syntax_palette_for_theme(theme_2.get_current_palette())
theme_2.apply_syntax_palette(palette_id)
# Language mapping for ImGuiColorTextEdit
self._lang_map = {
"python": _get_language_id("python"),