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

This is a pure Dart HTML5 parser. It's a port of html5lib from Python.

Usage

Parsing HTML is easy!

import 'package:html/parser.dart' show parse;

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.