[GH-ISSUE #671] serve: ordered lists whose items are separated by blank lines render every item as "1." #311

Closed
opened 2026-11-04 01:41:51 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kdmcser on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/671

What happens

Image

In the Chat tab an ordered list comes out with every item numbered 1. when the model puts a blank line between the items — a normal Markdown "loose list".

The model's answer is valid Markdown:

1. **Keep a regular schedule**
   Go to bed and get up at the same time every day.

2. **Optimise the bedroom**
   Quiet, dark, 18-22 C, a good mattress.

3. **Cut screen time before bed**
   Blue light suppresses melatonin.

but the page renders 1. / 1. / 1. with a paragraph-sized gap between the items.

Why

serve/web/app.js, in blocks():

if (!l.trim()) { flushPara(); flushList(); continue; }

A blank line closes the list unconditionally. When items are separated by blank lines, every item therefore becomes its own <ol> containing a single <li>, and the browser numbers each one 1.. CommonMark keeps blank-line-separated items inside one list (a loose list), so this is a renderer bug, not a model-output problem — it shows up with any model that puts a blank line between list items.

Fix

Keep the list open across a blank line when the next non-blank line is another item of the same type:

if (!l.trim()) {
  flushPara();
  // a blank line between list items keeps the list open (Markdown loose list);
  // otherwise the list ends here
  if (list) {
    const nxt = lines.slice(i + 1).find((x) => x.trim());
    const itemRe = list.tag === "ol" ? /^\s*\d+[.)]\s+/ : /^\s*[-*+]\s+/;
    if (!nxt || !itemRe.test(nxt)) flushList();
  }
  continue;
}

A list followed by a paragraph, a heading, a table, a blockquote or the end of the message still closes exactly as before, so nothing else changes.

Verified

Applied locally; the same answer then renders as a single <ol> with three <li> and shows 1. 2. 3. (browser-native decimal numbering, no custom counters or ::before).

Environment

  • Strata v0.1.38, commit 99f3dbd0b2
  • Windows 11 26H2 (build 26300)
  • RTX 5090, Qwen3.8-Flash-Next IQ3_S, context 131072
  • Chat tab, Chrome

Reported by an AI coding assistant (an agent working in the user's editor), at the user's request. The reproduction, the cause, the patch and the verification above were all done on the user's machine before reporting; a human reviewed the report before it was filed.

Originally created by @kdmcser on GitHub (Oct 3, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/671 ## What happens <img width="2212" height="916" alt="Image" src="https://github.com/user-attachments/assets/4cff382b-8540-4c6a-b761-30a5ecf16e26" /> In the Chat tab an ordered list comes out with every item numbered `1.` when the model puts a blank line between the items — a normal Markdown "loose list". The model's answer is valid Markdown: ```markdown 1. **Keep a regular schedule** Go to bed and get up at the same time every day. 2. **Optimise the bedroom** Quiet, dark, 18-22 C, a good mattress. 3. **Cut screen time before bed** Blue light suppresses melatonin. ``` but the page renders `1.` / `1.` / `1.` with a paragraph-sized gap between the items. ## Why `serve/web/app.js`, in `blocks()`: ```js if (!l.trim()) { flushPara(); flushList(); continue; } ``` A blank line closes the list unconditionally. When items are separated by blank lines, every item therefore becomes its own `<ol>` containing a single `<li>`, and the browser numbers each one `1.`. CommonMark keeps blank-line-separated items inside one list (a loose list), so this is a renderer bug, not a model-output problem — it shows up with any model that puts a blank line between list items. ## Fix Keep the list open across a blank line when the next non-blank line is another item of the same type: ```js if (!l.trim()) { flushPara(); // a blank line between list items keeps the list open (Markdown loose list); // otherwise the list ends here if (list) { const nxt = lines.slice(i + 1).find((x) => x.trim()); const itemRe = list.tag === "ol" ? /^\s*\d+[.)]\s+/ : /^\s*[-*+]\s+/; if (!nxt || !itemRe.test(nxt)) flushList(); } continue; } ``` A list followed by a paragraph, a heading, a table, a blockquote or the end of the message still closes exactly as before, so nothing else changes. ## Verified Applied locally; the same answer then renders as a single `<ol>` with three `<li>` and shows `1. 2. 3.` (browser-native `decimal` numbering, no custom counters or `::before`). ## Environment - Strata v0.1.38, commit 99f3dbd0b21d1401b3769e0c0d963913607f380b - Windows 11 26H2 (build 26300) - RTX 5090, Qwen3.8-Flash-Next **IQ3_S**, context 131072 - Chat tab, Chrome --- *Reported by an **AI coding assistant** (an agent working in the user's editor), at the user's request. The reproduction, the cause, the patch and the verification above were all done on the user's machine before reporting; a human reviewed the report before it was filed.*
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6155947431 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#311
No description provided.