Skip to content

🐛 fix(markdown): keep list markers in cells - #930

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/markdown-table-lists
Sep 30, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/markdown-table-lists

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

MarkItDown's migration loses list boundaries in pipe-table cells: * [Nasdaq](/nasdaq) * DJIA becomes [Nasdaq](/nasdaq) DJIA. Using cell_blocks="html" keeps the list markup but leaves links inside raw HTML instead of Markdown links.

The C serializer keeps compact * and numbered item markers when cell_blocks="text" flattens lists in table cells. It escapes markers inside emphasis and link text so GFM keeps those frames. Ordered start and item value attributes, nested lists, and orphan items retain their boundaries.

In a matched 20-cycle release+LTO run on the 394,444-byte Wikipedia fixture, the serializer was 1.36% slower than merged main while producing 1,416 additional bytes of list markers (192,147→193,563 bytes). Fifteen of 993 corpus outputs changed. MarkItDown's exact-head full-file benchmark measured 97.41→10.67 ms against markdownify.

@gaborbernat gaborbernat added the bug Something isn't working label Sep 30, 2026
@gaborbernat
gaborbernat force-pushed the fix/markdown-table-lists branch from 60fae94 to 1d0a5ad Compare September 30, 2026 04:24
@codspeed

codspeed Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 578 untouched benchmarks
⏩ 32 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_feature[select-relative-sibling] 42.7 µs 45.4 µs -5.95%
⚡ test_feature[conformance-sections-heading] 2.1 ms 1.1 ms +87.24%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing gaborbernat:fix/markdown-table-lists (5f51d47) with main (c671a6d)

Open in CodSpeed

Footnotes

  1. 32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@gaborbernat
gaborbernat force-pushed the fix/markdown-table-lists branch from 1d0a5ad to 5f51d47 Compare September 30, 2026 05:16
@gaborbernat
gaborbernat merged commit ea96af3 into tox-dev:main Sep 30, 2026
51 of 52 checks passed
gaborbernat added a commit that referenced this pull request Sep 30, 2026
Block elements nested inside `<code>` merged adjacent words in Markdown:
`<code><p>one</p><p>two</p></code>` produced `` `onetwo` ``. The C
renderer now adds a separator only where adjacent text runs meet at a
block boundary, preserving existing whitespace and inline adjacency.

Nested blocks inside `<pre><code>` gain line boundaries. The common
single-text preformatted path stays direct. The changelog also records
[#930](#930 table-cell
list-marker fix.

Across 990 real HTML pages, 989 Markdown outputs are byte-identical. The
remaining page gains a space between `Hunderassen:` and `Affenpinscher`.

Matched CPython 3.14.7 release-wheel ABBA timing used 24 runs per
workload. Candidate/base paired medians were +0.73% for ordinary code,
-0.71% for ordinary pre, and -0.68% for the 990-page corpus; negative
means faster. Median peak RSS (base/candidate) was 23.46/23.48 MiB for
code, 23.40/23.42 MiB for pre, and 58.42/58.42 MiB for the corpus.
Docker and an unrelated coverage run stayed active throughout (24/24
rounds).

An earlier 24-run diagnostic overlapped a CPU-bound diff process and
concurrent tests. Its paired medians were -0.23% for code, +1.26% for
pre, and +6.43% for the corpus; the diagnostic includes all 24 rounds.

CodSpeed reports a 5.08% slowdown in the unchanged `xpath-concat-nested`
case and warns that it compared different runtime environments. A
matched CPython 3.14.7 release+LTO comparison against current main used
the same nested input for all 24 predeclared ABBA runs: paired median
candidate/base +0.33%, identical output hashes, and median peak RSS
28.23/28.30 MiB (base/candidate).
@gaborbernat
gaborbernat deleted the fix/markdown-table-lists branch October 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant