commit | e5ebbc03ca37bab9f541f7db8da294752af1af14 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch@google.com> | Wed Oct 07 10:42:49 2020 -0700 |
committer | Nate Bosch <nbosch@google.com> | Wed Oct 14 15:37:05 2020 -0700 |
tree | e1a2e6d5c69a5c19e4faea35ff943db3db4704ba | |
parent | 143e79ef64ab9b8e9ab778fa5070b0730eec173a [diff] |
Migrate to null safety - Append `-nullsafety` to version. - Set min SDK to `2.11.0-0`, add `publish_to:none` since this package is not in the allow list. - 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.
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.