Clone this repo:
  1. 8243e96 Drop unnecessary severity upgrades (#181) by Nate Bosch · 5 months ago master
  2. 6416dd9 Bump actions/checkout from 2 to 3 (#176) by dependabot[bot] · 7 months ago
  3. f108bce Merge pull request #175 from dart-lang/move-escape by Sam Rawlins · 8 months ago
  4. 679d6c3 changelog by Sam Rawlins · 8 months ago
  5. 17297f3 Move htmlSerializeEscape into its own library by Sam Rawlins · 8 months ago

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;

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.