commit | 2599afe89f532859281cdb7aa1c9b827f3169429 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Thu Jun 11 16:53:59 2020 -0700 |
committer | GitHub <noreply@github.com> | Thu Jun 11 16:53:59 2020 -0700 |
tree | 409fb2eb037e0fd65fc5aa83ee5dad503e5483ba | |
parent | 083a36cd801a4b787ba156b7c6e4c8b2e2daed4a [diff] |
Refactor some utilities (#115) - Drop the `Predicate` typedef, it is unused. - Remove `parseIntRadix`, replace with `int.parse`. - Remove unnecessary `library` directives and a comment that added no information. - Drop unused constants. - Simplify `startsWithAny`. - Remove an ignore that was working around an analyzer bug which is fixed on the latest SDK. Skip lints/hints on older SDKs in travis.
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.