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.
4 files changed
tree: 409fb2eb037e0fd65fc5aa83ee5dad503e5483ba
  1. lib/
  2. test/
  3. .gitignore
  4. .test_config
  5. .travis.yml
  6. analysis_options.yaml
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
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.