Find test data files from package: URI (#149)

In Dart 2.12 the `Platform.packageConfig` changes from `.packages` to
`.dart_tool/package_config.json` which causes the data file discovery to
fail. Switch to resolving a `package:html` URI and assuming the pub
package layout which is more reliable and stable than the package config
file location.

- Migrate from `Platform.packageConfig` to `Isolate.resolvePackageUri`.
- Change the utility methods to be asynchronous and update the `main`
  for tests to `async`.
- Rename from `testDir` to `testDirectory`.
- Rename methods away from `get*`
4 files changed
tree: 16a82a1b63f9ed5cd8e6351afb4b7be28193574d
  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.