html
v0.15.7APIs for parsing and manipulating HTML content outside the browser.
Архив пакета: https://pubdev.letsnova.ru/api/archives/html/0.15.7.tar.gz
Установка
dart pub add htmlREADME
A Dart implementation of an HTML5 parser.
Usage
Parsing HTML is easy!
import 'package:html/parser.dart';
void 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.
Background
This package was a port of the Python html5lib library.
История изменений
0.15.7
writeTextNodeAsHtml: Escape text inside<script>and<style>-like tags in foreign namespaces.- Fix the tokenizer failing to close CDATA blocks when encountering extra brackets
- Require Dart
3.6 - Limit "Noah's Ark" clause to avoid degenerate O(N^2) when parsing deeply nested formatting elements with unique attributes.
- Added new
textContentmethod toNodeclass that returns the text content of the node. - Fix XSS vulnerability in
htmlToCodeMarkup()by escaping DOCTYPE, element, and attribute names.
0.15.6
- Performance improvements.
- No longer generate any error spans if generateSpans is false.
- Fixed a TypeError in nth-child with non numeric value (e.g.
nth-child(even))
0.15.5+1
- Support "ambiguous ampersand" in attribute values.
0.15.5
- Require Dart
3.2. - Move to
dart-lang/toolsmonorepo.
0.15.4
- Widen the dependency on
package:csslib. - Require Dart
2.19.
0.15.3
- Added package topics to the pubspec file.
0.15.2
- Add additional types at the API boundary (in
lib/parser.dartand others). - Adopted the
package:dart_flutter_team_lintslinting rules. - Fixed an issue with
querySelectorwhere it would fail in some cases with descendant or sibling combinators (#157). - Add an API example in
example/.
0.15.1
- Move
htmlSerializeEscapeto its own library,package:html/html_escape.dart, which is exported frompackage:html/dom_parsing.dart. - Use more non-growable lists, and type annotations on List literals.
- Switch analysis option
implicit-casts: falsetostrict-casts: true.
0.15.0
- Migrate to null safety.
- Drop
lastPhase,beforeRcDataPhase, andcontainerfields fromHtmlParserclass. These fields never had a value other thannull.
0.14.0+4
- Fix a bug parsing bad HTML where a 'button' end tag needs to close other elements.
0.14.0+3
- Fix spans generated for HTML with higher-plane unicode characters (eg. emojis).
0.14.0+2
- Support
package:css>=0.13.2 <0.17.0.
0.14.0+1
- Support
package:css>=0.13.2 <0.16.0.
0.14.0
BREAKING CHANGES
- Drop support for encodings other than UTF-8 and ASCII.
- Removed
parser_console.dartlibrary.
0.13.4+1
- Fixes to readme and pubspec.
0.13.4
- Require Dart 2.0 stable.
0.13.3+3
-
Do not use this tag in our systems - there was an earlier version of it pointing to a different commit, that is still in some caches.
-
Fix missing_return analyzer errors in
processStartTagandprocessEndTagmethods.
0.13.3+2
- Set max SDK version to
<3.0.0, and adjust other dependencies.
0.13.3+1
- Updated SDK version to 2.0.0-dev.17.0
0.13.3
- Update the signatures of
FilteredElementList.indexOfandFilteredElementList.lastIndexOfto include type annotations.
0.13.2+2
- Update signature for implementations of
Iterable.singleWhereto include optional argument.
0.13.2+1
- Changed the implementation of
SetandListclasses to use base classes fromdart:collection.
0.13.2
- Support the latest release of
pkg/csslib.
0.13.1
- Update Set.difference to take a Set
