Private
Public Access
0
0

fix(md_renderer_py): single push/pop per style (was 2x, styles never applied)

ROOT CAUSE: Each _push_em/_push_strong/_push_bold/etc. method called
imgui.push_style_color TWICE in a row with the same color. Then
_emit_styled_text's pop loop did 'for _ in range(pushed):
imgui.pop_style_color(); imgui.pop_style_color()' — popping 2x per
count. Net effect: 2 pushes canceled by 2 pops. The dim color for
em/code/strong was never actually applied to any text.

This is why 'table isn't properly rendering text based on annotation
syntax' — backticks were stripped by MD4C, the inline code was
emitted via text_wrapped, but the dim color was never pushed (push
canceled by pop), so the rendered text looked identical to body text.

FIX: Each _push_* method now pushes 1 style color. The pop loop now
pops 1 per count. Net: 1 push, 1 pop. The dim color is actually
applied to the text.

43/43 tests pass.
This commit is contained in:
Conductor
2026-06-03 23:29:30 -04:00
parent be5dffa4f0
commit f487c5741c
-2
View File
@@ -636,8 +636,6 @@ class MarkdownRenderer:
col = imgui.get_style().color_(imgui.Col_.text)
bright = (min(1.0, col.x * 1.3), min(1.0, col.y * 1.3), min(1.0, col.z * 1.3), col.w)
imgui.push_style_color(imgui.Col_.text, bright)
imgui.push_style_color(imgui.Col_.text, bright)
def _pop_bold(self) -> None:
imgui.pop_style_color()
imgui.pop_style_color()