Skip to content

Releases: rayd/html-parse-stringify2

2.0.1

10 Aug 15:41
Compare
Choose a tag to compare

Patch release:

  • Bug fix for handling boolean attributes by @des-des

2.0.0

24 Jul 20:35
Compare
Choose a tag to compare

Handful of bug fixes:

A potentially breaking change was introduced with respect to the handling of whitespace, hence the major version number increase. By default, the parser will now collapse whitespace instead of ignoring whitespace-only text nodes. This follows along more closely with the HTML spec: https://www.w3.org/TR/html4/struct/text.html#h-9.1.

A new option has been added to the parse() function -- a second parameter can be passed as an options object. It currently supports one option ignoreWhitespace, which will provide behavior compatible to the old version of this library where we ignored all whitespace-only nodes. Check out this test for an example.

1.2.0

27 Jun 21:08
Compare
Choose a tag to compare
  • Adds support for parsing HTML strings with comments.

  • Fixes issue with creating text nodes that are only whitespace. This is mostly a problem when paired with an <iframe> tag, which shouldn't have children appended inside it:

    e.g.

      <iframe src="https://example.com">
      </iframe>

    would create a child node with a newline and some spaces, which can cause problems.