You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[3.9 regression] Markdown: raw HTML in ordered list drifts right on every format with tabWidth 4 #19986
This appears to be a regression of #4112, previously fixed by #4115. It surfaced while testing the Markdown parser fix in #19838 against the real ultralytics/ultralytics docs tree. The affected downstream file is docs/en/guides/view-results-in-terminal.md; repeated formatter runs never converge.
Independent reproduction of this regression with a different trigger, which may help locate the common cause: it does not need raw HTML, an ordered list, or a non-default tabWidth.
Repro — prettier 3.9.6, default options, no config file:
-[x] a
onetwo
Repeated prettier --write:
after
one
two
run 1
col 6
col 10
run 2
col 6
col 14
run 3
col 6
col 18
run 4
col 6
col 22
The first line of the block stays put; every subsequent line gains four columns per run, without bound.
Same bisect as this issue reports, measured here on the repro above (column of two after runs 1–3):
version
3.8.5
6, 6, 6 — fixed point
3.9.0
10, 14, 18
3.9.6
10, 14, 18
So this lands in the same 3.8.5 → 3.9.0 window as the ordered-list/HTML case above, which I think is decent evidence the two are one regression rather than two.
Boundary, all measured against 3.9.6 with default options:
The task marker is load-bearing. The same block under a plain - item is a fixed point. - [ ] reproduces it identically to - [x].
The blank line is required. Without it, the same shape is a fixed point.
Two or more lines are required. A one-line block is a fixed point.
The block must start at or beyond the task item's content column (column 6 for - [x] ). At column 5 it normalises once and settles; at 6, 7 and 8 it never converges. A fenced block at column 6 diverges too.
Why the plain-text case may be worth having on file separately from the HTML ones (#18066, #18067): those repros all involve raw HTML or HTML comments, which makes "prettier is mishandling an HTML block" a plausible reading. Here the block is an ordinary paragraph, so whatever is re-indenting it is not HTML-specific.
I have not tried to identify the mechanism, so this is only the measured boundary rather than a theory about the cause.
Hi team, I would like to investigate and fix this regression.
In 3.9.6, raw HTML and indented content inside list items drift rightward on repeated formatting passes under Markdown parsing. I can trace the indentation calculation in the markdown printer to identify where nested element offsets are being accumulated rather than reset relative to the list marker column, and add regression tests covering both raw HTML and indented blocks inside lists.
Activity
Refzlund commentedon Sep 5, 2026
Independent reproduction of this regression with a different trigger, which may help locate the common cause: it does not need raw HTML, an ordered list, or a non-default
tabWidth.Repro — prettier 3.9.6, default options, no config file:
Repeated
prettier --write:onetwoThe first line of the block stays put; every subsequent line gains four columns per run, without bound.
Same bisect as this issue reports, measured here on the repro above (column of
twoafter runs 1–3):So this lands in the same 3.8.5 → 3.9.0 window as the ordered-list/HTML case above, which I think is decent evidence the two are one regression rather than two.
Boundary, all measured against 3.9.6 with default options:
-item is a fixed point.- [ ]reproduces it identically to- [x].- [x]). At column 5 it normalises once and settles; at 6, 7 and 8 it never converges. A fenced block at column 6 diverges too.Why the plain-text case may be worth having on file separately from the HTML ones (#18066, #18067): those repros all involve raw HTML or HTML comments, which makes "prettier is mishandling an HTML block" a plausible reading. Here the block is an ordinary paragraph, so whatever is re-indenting it is not HTML-specific.
I have not tried to identify the mechanism, so this is only the measured boundary rather than a theory about the cause.
webdevsamran commentedon Sep 6, 2026
Hi team, I would like to investigate and fix this regression.
In 3.9.6, raw HTML and indented content inside list items drift rightward on repeated formatting passes under Markdown parsing. I can trace the indentation calculation in the markdown printer to identify where nested element offsets are being accumulated rather than reset relative to the list marker column, and add regression tests covering both raw HTML and indented blocks inside lists.
Could you please assign this to me? Thanks!