Repository navigation
fix(html2md): retain complex tables and referenced fragments - #1336
Conversation
Spider Bench A/B✅ All benchmark browser service runs completed; results are informational. Public HEAD: 184 / 240 rows; 38 / 48 sites produced rows; 10 unexpected empty sites. ✅ Deterministic fixture contract is clean. Common ancestor Public 48-site run · informational
Public-site content, timing, and memory are noisy. This single A/B run reports evidence only; site outcome counts explain missing rows without treating them as a deterministic regression. CPU and memory timelinesThese are bounded 40-point views of the same complete process-tree samples used by the HTML report. CPU uses 100% per occupied logical core; memory lines are RSS first and PSS second when complete PSS samples are available. Basexychart-beta
title "Base CPU"
x-axis "Elapsed seconds" [1.038, 1.539, 2.54, 4.043, 5.545, 6.547, 8.049, 9.549, 11.049, 12.05, 13.553, 15.054, 16.056, 17.557, 19.06, 19.561, 20.062, 21.565, 23.066, 24.567, 25.068, 25.568, 27.068, 28.57, 29.571, 31.073, 32.574, 33.575, 35.077, 36.579, 37.579, 39.081, 40.582, 42.084, 43.085, 44.587, 46.09, 47.092]
y-axis "CPU percent" 0 --> 200
line [2, 61.91, 83.96, 115.87, 159.75, 177.63, 111.85, 135.98, 142.01, 59.97, 57.85, 89.87, 33.91, 77.88, 103.78, 0, 7.99, 101.8, 109.86, 124, 101.9, 109.85, 118, 129.91, 91.92, 111.8, 48.04, 51.93, 109.87, 4, 140.06, 133.93, 58.04, 3.99, 2, 115.9, 9.98, 125.83]
xychart-beta
title "Base memory: RSS then PSS"
x-axis "Elapsed seconds" [0.036, 1.038, 1.539, 2.54, 4.043, 5.545, 6.547, 8.049, 9.549, 11.049, 12.05, 13.553, 15.054, 16.056, 17.557, 19.06, 19.561, 20.062, 21.565, 23.066, 24.567, 25.068, 25.568, 27.068, 28.57, 29.571, 31.073, 32.574, 33.575, 35.077, 36.579, 37.579, 39.081, 40.582, 42.084, 43.085, 44.587, 46.09, 47.092, 48.191]
y-axis "Memory MiB" 0 --> 500
line [12.97, 61.93, 85.42, 100.89, 128.06, 145.5, 181.32, 197.18, 131.05, 141.03, 129.1, 135.36, 138.05, 121.29, 137.45, 115.46, 115.46, 115.04, 151.69, 150.77, 181.08, 250.33, 220.95, 190.23, 165.77, 147.36, 141.2, 132.39, 136.09, 130.08, 136.89, 191.88, 223.58, 154.6, 128.98, 130.05, 158.47, 143.66, 159.08, 0]
line [9.4, 58.19, 81.67, 97.15, 123.03, 141.8, 177.88, 193.25, 126.37, 137.25, 125.35, 131.61, 134.53, 117.56, 133.68, 111.69, 111.69, 111.03, 147.93, 147.02, 177.36, 246.47, 216.83, 186.45, 162.25, 143.61, 136.78, 128.7, 132.32, 125.13, 133.13, 188.25, 219.73, 150.83, 125.21, 126.27, 154.78, 139.88, 155.33, 0]
HEADxychart-beta
title "HEAD CPU"
x-axis "Elapsed seconds" [1.037, 2.038, 3.041, 3.542, 4.043, 4.543, 5.043, 5.544, 6.544, 7.544, 9.045, 10.046, 11.048, 12.048, 13.048, 14.551, 15.555, 16.556, 17.56, 18.563, 20.064, 21.066, 22.067, 23.069, 24.07, 25.072, 26.575, 27.575, 28.576, 29.578, 30.579, 32.081, 33.081, 34.082, 35.083, 36.084, 37.586, 38.587]
y-axis "CPU percent" 0 --> 200
line [5.99, 109.81, 115.79, 115.77, 143.72, 149.86, 119.91, 155.84, 100, 145.96, 137.66, 137.97, 93.75, 102, 101.94, 3.99, 37.78, 111.89, 69.45, 103.75, 99.83, 107.72, 127.75, 89.9, 135.78, 109.83, 43.91, 55.94, 101.92, 17.99, 49.91, 67.9, 13.99, 4, 141.89, 137.89, 100.05, 127.88]
xychart-beta
title "HEAD memory: RSS then PSS"
x-axis "Elapsed seconds" [0.036, 1.037, 2.038, 3.041, 3.542, 4.043, 4.543, 5.043, 5.544, 6.544, 7.544, 9.045, 10.046, 11.048, 12.048, 13.048, 14.551, 15.555, 16.556, 17.56, 18.563, 20.064, 21.066, 22.067, 23.069, 24.07, 25.072, 26.575, 27.575, 28.576, 29.578, 30.579, 32.081, 33.081, 34.082, 35.083, 36.084, 37.586, 38.587, 39.123]
y-axis "Memory MiB" 0 --> 500
line [12.81, 63.55, 106.27, 117.32, 106.03, 130.46, 138.24, 158.8, 145.29, 127.69, 132.01, 144.49, 142.61, 145.26, 138.22, 138.97, 115.16, 129.39, 162.57, 139.23, 144.22, 248.13, 170.89, 183.29, 129.51, 145.51, 140.37, 133.04, 134.94, 139.99, 139.42, 136.21, 133.76, 124.12, 122.98, 146.41, 139.87, 140.07, 156.35, 0]
line [9.34, 59.88, 103.64, 113, 102.33, 127.74, 134.58, 155.08, 141.58, 123.92, 128.24, 140.8, 138.36, 141.42, 130.24, 135.21, 111.3, 125.49, 158.69, 135.35, 140.3, 244.36, 167.19, 179.58, 125.79, 141.84, 136.65, 129.53, 131.23, 136.17, 135.71, 132.58, 130.15, 120.41, 119.26, 141.55, 137.72, 136.35, 152.62, 0]
Deterministic fixture · required contractThe fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.
Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full The public-web A/B is informational. The exact HEAD fixture contract runs as a separate required CI check; timing and public-site content deltas remain non-blocking. |
CI Regression ReportSource CI run · source state at render:
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.028392%Package and image size
Startup latency and PSS
Concurrency matrix
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
CDP smoke — ✅ 106/106 groups passed; 1,260 scenariosWorkers: 4 · cumulative group time: 430.46 s · failed groups: 0
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Frozen HTML · Linux · Diagnostics: All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable. |
fd2db36 to
6ed184d
Compare
Sequential Navigation Soak A/B✅ HEAD completed the 200-navigation resilience and memory observation. One browser process, one target, and one CDP session navigate CSDN → SegmentFault → Huaban → example.com repeatedly. This run issued 200 Common ancestor Session resilience
A public-page failure is reported separately from an unrecoverable session. The soak requires all navigation attempts, zero failed recovery, zero lifecycle/network ordering violations, and complete resource evidence. Process-tree memory
HEAD memory by 50-navigation quarter
Raw reports and per-navigation boundary samples: workflow run and full Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold. |
6ed184d to
22760a4
Compare
13a8b62 to
da9b680
Compare
ba33592 to
a863725
Compare
a863725 to
eb8ccd8
Compare
eb8ccd8 to
59c3c4d
Compare
|
Closing after the consolidation audit. This belongs to an earlier experimental Markdown stack and was not part of the measured fixed build. Current failure evidence does not justify carrying its broad table and fragment expansion into #1501, so it is intentionally not merged. |
Use the current control-value and accessible-name helpers in structural HTML fallback. Preserve MathML wrappers and surrounding whitespace while filtering visual alternatives. Cover formatted math links with ordinary and nonbreaking spaces in both Markdown and structural HTML output.
803de4b to
e2f8b8e
Compare
Use inline span markers for synthesized fragment targets so a target inside an author link does not create nested anchors. Check link ownership after rendering and reparsing output.
Track active HTML links and render nested media destinations as text, matching the Markdown path. Cover video, audio and iframe content in body, GFM and HTML table output.
Share structural classifications with the HTML fallback so authored blocks retain boundaries. Cover adjacent sections and related semantic blocks, and retain the authored center wrappers in the layout fixture.
Track readable content independently of tags and fragment targets in both writers. Propagate child content marks through captures and carry HTML content metadata, so empty wrappers do not suppress accessible names.
Collect table header IDREFs independently of fragment navigation, and preserve target IDs on header cells. Validate that each headers reference resolves after HTML reparsing, including adapters that report no fragment links.
Remove redundant vector scans during target collection and retain global HashSet deduplication. Cover wide MathML target sets and duplicate IDs without a wall-clock threshold.
Use the same presentational-role policy in both renderers. Scope table expansion so nested data tables keep their structure.
Queue targets for sections and other omitted table elements at the next converted cell. Preserve trailing empty-group targets after the table without enlarging each cell plan.
Separate synthesized input values from adjacent values and labels in structural HTML output. Reparse paired numeric and labeled fields across all output paths.
Keep authored open attributes on dialogs and details so retained elements preserve their visibility state. Test boolean attribute presence, including empty and false-valued attributes.
Pass the active writer link into inline HTML fallback while keeping block output outside Markdown formatting. Keep audio resources inline inside code so HTML reparsing preserves author links and unique fragment IDs.
Distinguish normal text, inline code and pre blocks when counting readable content. Honor preformatted_code for inline code and keep blank pre content consistent with the Markdown writer, including referenced code that switches output paths.
Apply the existing serialized-state filter before specialized branches, layout wrappers and target output. Cover hidden textarea and MathML payloads while retaining hidden prose, short JSON and overridden display declarations.
Use replacement characters for invalid UTF-8 after percent decoding while preserving raw-fragment precedence. Keep the valid UTF-8 buffer reuse path and cover incomplete sequences, valid prefixes and literal ID matches.
Complex tables need to retain cell relationships and block content, and fragment links need stable targets. This change keeps simple tables in GFM and uses structural HTML when Markdown cannot represent the authored relationships.
Changes
hrefinto non-link target markers. Their media keep clickable resource links; real author links retain ownership of their content. Both output paths share the accepted-href selection.Validation
cargo fmt --allcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run --no-fail-fast: 20,927 passed, 19 skipped.cargo test -p moli-html2md --locked: 454 passed.Regression tests convert actual input, render the resulting Markdown with pulldown-cmark, and reparse it with html5ever. They check link ownership, target uniqueness, exact code text, block boundaries, deletion semantics, and column/header structure. Paired cases cover ordinary content, GFM cells, and structural HTML cells. Tests also cover formatting inherited across the block fallback boundary, formatted Pre blocks with blank lines, and MathML between CR and LF. Placeholder and real-link comparisons cover video/audio/iframe, id/name aliases, unsafe or empty destinations, Code/Pre, inherited link state, and the next independent resource. Commits are split by correctness issue. Pipe tests check both pulldown-cmark output and direct HTML attribute parsing; Pandoc was not run in this environment.
Earlier end-to-end evidence
Mechanism diagram and frozen-page evidence records the earlier seven-page WebMainBench check from the original stack. That evidence belongs to Moli commit
19bfc785f2e0114d7d88e17457de7c108a54069d; it was not rerun for these revisions. The current validation above covers the converter and workspace tests.