html_parser 0.6.0

  • Installing
  • Versions
  • 0

html_parser #

Build Status Pub

A fast and forgiving HTML parser for Dart. Loosely based on htmlparser2.

This package is in development as an experiment to replace the transpiled HTML parser from angular_2. It is not meant to be a full DOM parser, or to emulate behavior of the browser - for that see package:html.

Goals are speed, ease of use, and great error messages.

Usage #

import 'package:html_parser/html_parser.dart';

void main() {
  var fragment = parseHtml('<div>Hello World</div>');

  // Prints: '<div>Hello World</div>'

Limitations #

Some things missing from making this a package ready to use for all:

See issues for more details and to contribute!

Changelog #

0.6.0 #

  • Exported Attribute and Comment nodes as part of the public API
  • Exported HtmlVisitor and PrinterHtmlVisitor
  • Added .fromToken(s) APIs for some of the Element ASTs (internal use)

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  html_parser: ^0.6.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:html_parser/html_parser.dart';
Version Uploaded Documentation Archive
0.6.0 Oct 10, 2016 Go to the documentation of html_parser 0.6.0 Download html_parser 0.6.0 archive
0.5.0 Oct 8, 2016 Go to the documentation of html_parser 0.5.0 Download html_parser 0.5.0 archive
0.4.0 Oct 2, 2016 Go to the documentation of html_parser 0.4.0 Download html_parser 0.4.0 archive
0.2.0 Oct 1, 2016 Go to the documentation of html_parser 0.2.0 Download html_parser 0.2.0 archive
0.1.1 Oct 1, 2016 Go to the documentation of html_parser 0.1.1 Download html_parser 0.1.1 archive
0.1.0+dev Oct 1, 2016 Go to the documentation of html_parser 0.1.0+dev Download html_parser 0.1.0+dev archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0