fix(renderer): ordered list items always showed 1. — emit value= on each li (#886) (#904)

* fix(renderer): ordered list items always showed 1. — emit value= on each <li> (#886)

Root cause: when LLMs output numbered lists with blank lines between items,
renderMd()'s paragraph-splitter (split(/\n{2,}/)) breaks the markdown into
one chunk per item. The ordered-list regex then wraps each item in its own
<ol>, and since each <ol> restarts at 1, the rendered output is always 1. 1. 1.

Fix: capture the original number from each list line and emit value="N" on
every <li>. The HTML spec guarantees that value= overrides the <ol> counter,
so even items in separate <ol> containers display their correct ordinal.

6 regression tests in tests/test_886_ordered_list_numbering.py.
1958 tests pass.

* chore: add v0.50.173 CHANGELOG entry for ordered list fix

---------

Co-authored-by: Hermes Bedrock Fix <hermes-fixes@local>
Co-authored-by: nesquena-hermes <nesquena-hermes@users.noreply.github.com>
This commit is contained in:
nesquena-hermes
2026-04-23 12:15:56 -07:00
committed by GitHub
parent 9dd6e3f338
commit 537c8271db
3 changed files with 110 additions and 1 deletions

View File

@@ -29,6 +29,16 @@
workspace subtree) and never enumerate blocked system roots. (`api/routes.py`,
`api/workspace.py`, `static/panels.js`, `static/style.css`) (partial for #616)
## [v0.50.173] — 2026-04-23
### Fixed
- **Ordered list items always showed "1." regardless of position** — when LLMs
output numbered lists with blank lines between items, the paragraph-splitter
in `renderMd()` placed each item in its own `<ol>` container, causing every
`<ol>` to restart at 1. Fixed by emitting `value="N"` on each `<li>` so the
correct ordinal is preserved even when items are split across multiple `<ol>`
wrappers. (`static/ui.js`) Closes #886. Co-authored by @bsgdigital.
## [v0.50.172] — 2026-04-23
### Fixed