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

Closes #122

Add 'button' to the tags that are processed with `endTagBlock`. The spec
at 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

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. lib/
  2. test/
  3. .gitignore
  4. .test_config
  5. .travis.yml
  6. analysis_options.yaml
  9. pubspec.yaml

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


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="">HTML5 rocks!');

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.