Skip to content

Releases: inikulin/parse5

v7.3.0

22 Apr 17:05
d34155c
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v7.2.1...v7.3.0

v7.2.1

28 Oct 10:22
8822d8d
Compare
Choose a tag to compare

What's Changed

  • Bump dependencies
  • fix: export tree adapter types as namespace to support TS4.x by @43081j in #1313
  • chore: bump parse5 to 7.2.1 by @43081j in #1314

Full Changelog: v7.2.0...v7.2.1

v7.2.0

16 Oct 03:35
beed7d7
Compare
Choose a tag to compare

What's Changed

  • Bump dependencies
  • docs(readme): Fix CI badge by @fb55 in #765
  • feat(parser): Support search element by @fb55 in #452
  • docs: fix variable name in sample code by @nolanlawson in #879
  • refactor(tokenizer): Use entities' new decoder by @fb55 in #897
  • chore(site): Fix typedoc config by @fb55 in #926
  • chore(package): Update homepage URL by @fb55 in #930
  • feat(parse5): change parser/tokenizer methods to be protected by @43081j in #996
  • refactor: expose createTextNode on defaultTreeAdapter by @jmsjtu in #1040
  • chore(ci): Update tested NodeJS versions by @fb55 in #1061
  • refactor(open-element-stack): Use sets everywhere by @fb55 in #1086
  • fix: don't generate sourcemap on build, close #831 by @antfu in #1113
  • chore: upgrade to eslint 9.x by @43081j in #1267
  • chore: upgrade to typescript 5.6 by @43081j in #1274
  • fix: fix <noframes> parsing by @nolanlawson in #1277
  • fix: use typedoc config to avoid accidental inheritance by @43081j in #1287
  • chore: bump version to 7.2.0 by @43081j in #1291

New Contributors

Full Changelog: v7.1.2...v7.2.0

v7.1.2

20 Nov 21:58
1f34d80
Compare
Choose a tag to compare

This release includes parse5 and parse5-parser-stream.

Full Changelog: v7.1.0...v7.1.2

v7.1.0

02 Sep 16:43
2d63a63
Compare
Choose a tag to compare

This release is only for the parse5 module.

What's Changed

New Contributors

Full Changelog: v7.0.0...v7.1.0

v7.0.0

20 Apr 11:17
abec4c2
Compare
Choose a tag to compare

Welcome to [email protected]! ✨ This is a huge release with many changes, features and fixes.

From an organisational perspective, the most important change is that parse5 is now maintained by a team, consisting of James (@43081j), Titus (@wooorm) and me (@fb55). We come from three projects that rely on parse5 — namely Cheerio, rehype, and Lit.

We need your support to continue the project! If you care about parse5, please support us financially on OpenCollective.

Headlining features of this release are ES Modules, TypeScript, and performance improvements: 7.0.0 is 45% faster than 6.0.1 with default options, and 167% faster with location information enabled (for the bench/perf benchmark, on an M1 Mac). Version 7.0.0 is a revamp of every part of the library. There are too many changes to list them all here, so here is a high-level overview:

Breaking: ESM

All of parse5’s packages are now ECMAScript Modules. We are providing dual packages for parse5 and parse5-htmlparser2-tree-adapter for now (see #418 and #496).

To migrate, please read this Gist on how to update. Note that private internals are no longer available; instead, everything that you need should be imported from the main package.

Implemented by @43081j in #351

Breaking: TypeScript

The codebase has been ported to TypeScript. This helped uncover a number of subtle logic bugs, such as dc4e269, b4b5d4a, or a0aff95. TypeScript also helps us refactor with confidence and a lot of the changes in this release would have been much harder to do without it.

To migrate, please remove @types/parse5* as we now ship our own types.

Implemented by @fb55 in #362

Potentially breaking changes

  • parse5 was caught up with the HTML spec, and parsing results might differ in edge-cases (#442, #451)
  • The parse5-serializer-stream package was removed #481
    • To migrate, use the serialize function exported by parse5.
  • The rewriting stream now splits very long text sections (#434) and doesn’t escape text in special tags anymore (#434). If you worked around these issues before, you might have to update your code.
  • The htmlparser2 adapter now uses domhandler’s node interface (#327 by @TrySound)
    • The format of the tree nodes has changed slightly; eg. some previous properties are now getters and setters, and vice versa.

If you are using deep imports for any parts of the codebase, you will likely encounter some breakages:

Show internal changes
  • The tokenizer now uses the state machine pattern from htmlparser2 5d7a780 (#362)
  • The token queue was replaced with callbacks (#404, #405, #419)
  • The OpenElementStack now uses callbacks #429
  • Mixins were removed (as part of #362)
    • Location tracking now has a substantially lower overhead #402
  • getNextToken was removed #461
  • The parser’s _bootstrap method was removed #384
  • We now drop chunks from the tokenizer right after they are emitted #432
  • The serializer is no longer a class; instead, different serializer functions call on each other #383
  • parse5 now uses the entities module for encoding and decoding entities, sharing maintenance & optimisation work with projects such as htmlparser2 (2b92054 (#362), #486)
    • entities adopted a variant of parse5’s approach of decoding entities. As a result, decoding performance is equivalent, while memory consumption is slightly lower.

Other changes

  • minor add hooks for stack events to tree adapter interface #385
  • minor add support for fragments in parse5-parser-stream #487
  • minor add serializeOuter (like .outerHTML), scriptingEnabled option #383
  • patch fix parsing of << in comments parsed wrongly as <! (#326)
  • patch fix position of endTag for mixed-case foreign elements (#353)
  • patch fix end position of html, body (#436)
  • docs: parse5 has a new documentation website at parse5.js.org #443

New Contributors

Thanks @anko, @TrySound, @samouri, @alan-agius4, and @pmdartus!

Full Changelog: v6.0.1...v7.0.0

v6.0.1

07 Jan 14:17
Compare
Choose a tag to compare
  • Fixed: Handling of self-closing <hr> tags (by @43081j).
  • Fixed: Broken link in TreeAdapter document (GH #317) (by @ursm).
  • Fixed: SAXParser example (GH #316) (by @mvasilkov).

v6.0.0

07 Jan 14:19
Compare
Choose a tag to compare
  • Added (breaking): Tree adapter interface now has updateNodeSourceCodeLocation method which enables usage of custom location info formats (GH #314) (by @DMartens).

v5.1.1

06 Nov 10:39
Compare
Choose a tag to compare
  • Fixed: Serialization of attributes in non-standard namespaces (by @Zirro).
  • Fixed: Quirks and limited-quirks mode detection by doctype (by @squidfunk).

v5.1.0

14 Aug 16:23
Compare
Choose a tag to compare
  • Fixed: Location info for text events in SAXParser and RewritingStream now contains
    correct endCol and endLine covering all concatenated raw tokens (GH #266).
  • Fixed: SAXParser and RewritingStream now flush last buffered chunk when calling .end() with
    no parameters (GH #271).
  • Updated (breaking): ParserStream, SAXParser and RewritingStream no longer assume that
    each binary chunk is a valid finished UTF-8 chunk, and instead accept only decoded strings (GH #269).