Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion strix/interface/tui/renderers/agent_message_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _apply_markdown_styles(text: str) -> Text: # noqa: PLR0912
result.append_text(_process_inline_formatting(line[2:]))
elif len(line) > 2 and line[0].isdigit() and line[1:3] in (". ", ") "):
result.append(line[0] + ". ", style="#22c55e")
result.append_text(_process_inline_formatting(line[2:]))
result.append_text(_process_inline_formatting(line[3:]))
elif line.strip() in ("---", "***", "___"):
result.append("─" * 40, style="#22c55e")
else:
Expand Down
23 changes: 23 additions & 0 deletions tests/test_agent_message_renderer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Tests for markdown styling in the agent-message TUI renderer."""

from __future__ import annotations

from strix.interface.tui.renderers.agent_message_renderer import _apply_markdown_styles


def test_numbered_list_has_single_space_after_marker() -> None:
result = _apply_markdown_styles("1. Hello").plain

assert result == "1. Hello"
assert "1. Hello" not in result


def test_numbered_list_paren_marker_normalized_single_space() -> None:
result = _apply_markdown_styles("2) World").plain

assert result == "2. World"
assert "2. World" not in result


def test_bullet_list_marker_unaffected() -> None:
assert _apply_markdown_styles("- Item").plain == "• Item"