commit | 00cd3c22dac0e68e6ed9e7e4945101aedb1b3109 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch@google.com> | Mon Jan 25 15:05:28 2021 -0800 |
committer | GitHub <noreply@github.com> | Mon Jan 25 15:05:28 2021 -0800 |
tree | f8ad4807042bc024677c47dcc992fed7157b187d | |
parent | 1eb086fd2ac27159c479fb5b09154d8e9788cf42 [diff] | |
parent | c1997dc8153eec29a672aa63f2b51b58c895569f [diff] |
Migrate to null safety (#139) - Append `-nullsafety.0` to version. - Set min SDK to `2.12.0-0`. - Use late field initialization over constructor assignment to clean up the handling of backreferences in the different "phases". - Remove some conditional branches that are impossible to hit. - Make the non-nullable override of Text nodes explicit with `covariant`.
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.