Skip to content

feat: output was HTML only, with no pretty or html5lib format - #93

Merged
jamesconwaydev merged 1 commit into
mainfrom
sync-serializer
Nov 19, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
sync-serializer

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Collaborator

Problem

Parsec serialized innerHTML, outerHTML and text only (#9), where Lexbor also has a pretty-printer and the html5lib tree format.

The sync script also named each synced test file by hand, so a new test in Netweir, such as tests/serializer.rs, didn't come across.

Change

  • Syncs Netweir 8513cf3 (feat(html): output was HTML only, with no pretty or html5lib format netweir/netweir#330): SerializeOptions and Document::serialize_with/inner_html_with.
    • pretty: indents without changing what the page parses to. Every tree-construction case that round-trips, and the 13 bench pages, parse back to the same tree.
    • html5test: the | <html> dump the tree-construction tests use. tests/tree.rs now uses it.
    • html5lib's serializer options, such as quoting, boolean attributes, optional tags and meta charset.
    • Default output is byte for byte as before, at the same speed.
  • scripts/sync-from-netweir.sh takes every entry under tests/ except html5lib-tests and tree-construction, which stay Parsec's own.
  • README and ROADMAP mark Pretty-printed and html5lib-format serialization #9 done.

Closes #9

Tests

  • html5lib serializer suite: 229 passed, 0 failed, 1 skipped. The skipped case expects </p> left out before <datagrid>, which would change the tree.
  • Tokenizer 7,045 and tree construction 3,898 passed, 0 failed. cargo test --workspace: 193 test groups, 0 failed.
  • sync-from-netweir.sh --check passes, and so do shellcheck and scripts/check-headers.sh.

Syncs Netweir 8513cf3 (netweir/netweir#330): SerializeOptions with
pretty printing that keeps the tree, the html5lib tree-dump format, and
html5lib's serializer options (quote_char, minimize_boolean_attributes,
omit_optional_tags, inject_meta_charset and the rest), with the
html5lib serializer suite in cargo test: 229 passed, 1 skipped.

The sync script listed its test files one by one, so the new
tests/serializer.rs wasn't copied. It now takes every test and its data
but the html5lib-tests submodule and the pinned tree-construction
files.
@jamesconwaydev
jamesconwaydev enabled auto-merge (squash) November 19, 2026 05:29
@jamesconwaydev
jamesconwaydev merged commit a07d3d9 into main Nov 19, 2026
32 checks passed
@jamesconwaydev
jamesconwaydev deleted the sync-serializer branch November 19, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pretty-printed and html5lib-format serialization

1 participant