Skip to content

fix(tui): remove double space after numbered-list marker#686

Open
sean-kim05 wants to merge 1 commit into
usestrix:mainfrom
sean-kim05:fix/numbered-list-double-space
Open

fix(tui): remove double space after numbered-list marker#686
sean-kim05 wants to merge 1 commit into
usestrix:mainfrom
sean-kim05:fix/numbered-list-double-space

Conversation

@sean-kim05

Copy link
Copy Markdown

Closes #684

What

In strix/interface/tui/renderers/agent_message_renderer.py, _apply_markdown_styles() renders an ordered-list line by emitting its own "N. " prefix and then re-rendering the remainder starting at line[2:]. A numbered marker ("1. ") is 3 characters, so line[2:] still contains the marker's trailing space — producing a doubled space.

Before

1.  Hello      # two spaces

After

1. Hello       # one space

Why

The sibling bullet branch uses line[2:] correctly because "- " is exactly 2 chars. The numbered branch needs line[3:] to skip the full 3-char marker.

Change

One character: line[2:]line[3:], confined to the numbered-list branch. Blockquote/bullet branches are unchanged (still line[2:], verified).

Tests

Added tests/test_agent_message_renderer.py:

  • "1. Hello""1. Hello" (single space)
  • "2) World""2. World"
  • bullet unaffected: "- Item""• Item"

These fail on the old line[2:] (double space) and pass with the fix. Full suite: 86 passed; ruff check/format clean; mypy adds no new errors.

The ordered-list branch in _apply_markdown_styles emitted its own
"N. " prefix and then re-rendered the remainder from line[2:], which
still includes the marker's trailing space (a numbered marker like
"1. " is 3 chars). The result was a doubled space, e.g. "1.  Hello".
Slice from line[3:] to skip the whole marker, matching the 2-char
bullet branch that already uses line[2:]. Add regression tests.

Closes usestrix#684
@greptile-apps

greptile-apps Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes ordered-list spacing in the TUI markdown renderer. The main changes are:

  • Uses the full three-character numbered marker when slicing list item text.
  • Adds tests for dot-style and paren-style numbered lists.
  • Adds a bullet-list test to confirm that branch is unchanged.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The renderer branch only matches three-character single-digit markers, and the new slice matches that marker length.
  • The added tests cover the reported spacing regression and the nearby bullet path.

Important Files Changed

Filename Overview
strix/interface/tui/renderers/agent_message_renderer.py Changes the ordered-list branch to remove the full N. or N) marker before inline formatting.
tests/test_agent_message_renderer.py Adds focused tests for numbered-list spacing and unchanged bullet rendering.

Reviews (1): Last reviewed commit: "fix(tui): remove double space after numb..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numbered-list markdown renders a double space after the marker

1 participant