Skip to content
Dart port of html5lib. For parsing HTML/HTML5 with Dart. Works in the client and on the server.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Code cleanup (#96) Apr 11, 2019
test Don't depend on `pacakge:utf` (#95) Apr 9, 2019
.gitignore update the changelog Mar 10, 2018
.test_config
.travis.yml Remove support for deprecated encodings and parser_console.dart libra… Apr 8, 2019
CHANGELOG.md
LICENSE
README.md Remove broken link from readme Apr 5, 2019
analysis_options.yaml fix tiny lint issues Mar 4, 2019
pubspec.yaml Support the latest pkg:csslib, prepare to release 0.14.0+1 Apr 11, 2019

README.md

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;
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.

You can’t perform that action at this time.