Skip to content

v0.0.213

Choose a tag to compare

@tamnd tamnd released this 28 Apr 11:41
· 4 commits to main since this release
v0.0.213
6a32f66

v0.0.213

Fixture 213: html module — html.escape, html.unescape, html.entities, html.parser.HTMLParser.

Changes

  • src/vm/html_mod.zig: full rewrite
    • HTML4 entity table (~253 entries) used for unescape named-entity lookup, html.entities.name2codepoint, html.entities.codepoint2name, and html.entities.html5
    • escape(s, quote=True): escapes &, <, >, and optionally ", '
    • unescape(s): handles named entities, &#NNN;, &#xHH;
    • buildEntities: builds html.entities module with name2codepoint (dict), codepoint2name (dict), html5 (dict, 253+ entries keyed as "name;")
    • buildParser: builds html.parser module with HTMLParser class; tokenizer handles text, comments (<!-- -->), declarations (<!), end tags, start tags, and self-closing tags; default handle_startendtag calls handle_starttag + handle_endtag
  • src/vm/interp.zig: added html_entities_module, html_parser_module, html_parser_class fields; added "html.entities" and "html.parser" dispatch blocks
  • tests/fixtures/fixtures.zig: added 213_html
  • tests/fixtures/213_html.*: fixture files copied from goipy testdata

All 213 fixtures pass. All 5 cross-compilation targets clean.

Full Changelog: v0.0.212.2...v0.0.213