Fix infinite loop with bad button close tag (#128)

Closes #122

Add 'button' to the tags that are processed with `endTagBlock`. The spec
at https://html.spec.whatwg.org/multipage/parsing.html includes 'button'
in the list of end tags with this treatment.

Add a new `.dat` file for regression test. It include an `#info` field
which is new but can be parsed safely to mark the issue for which it is
a test. This test loops endlessly before the fix and passes after the
fix.

Note that since errors are currently untested and tests fail if they are
tested the error will be left without content for now.
4 files changed
tree: 1f4028c546772d5eaeb31a3c1f67dd7437b925b2
  1. .gitignore
  2. .test_config
  3. .travis.yml
  4. CHANGELOG.md
  5. LICENSE
  6. README.md
  7. analysis_options.yaml
  8. lib/
  9. pubspec.yaml
  10. test/
README.md

This is a pure Dart HTML5 parser. It's a port of html5lib from Python.

Usage

Parsing HTML is easy!

import 'package:html/parser.dart' show parse;
import 'package:html/dom.dart';

main() {
  var document = parse(
      '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!');
  print(document.outerHtml);
}

You can pass a String or list of bytes to parse. There's also parseFragment for parsing a document fragment, and HtmlParser if you want more low level control.