commit | 22f17e97fedeacaa1e945cf84d8016284eed33a6 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Fri Sep 25 09:43:37 2020 -0700 |
committer | GitHub <noreply@github.com> | Fri Sep 25 09:43:37 2020 -0700 |
tree | 1f4028c546772d5eaeb31a3c1f67dd7437b925b2 | |
parent | 2599afe89f532859281cdb7aa1c9b827f3169429 [diff] |
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.
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="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.