Skip to content

Releases: rayd/html-parse-stringify2

v2.0.2

Choose a tag to compare

@rayd rayd released this 09 Mar 18:19

What's Changed

2.0.1

Choose a tag to compare

@rayd rayd released this 10 Aug 15:41

Patch release:

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

2.0.0

Choose a tag to compare

@rayd rayd released this 24 Jul 20:35

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

Choose a tag to compare

@rayd rayd released this 27 Jun 21:08
  • 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.