pub repository
mirror.p-hatan.irhtml
0.15.4APIs for parsing and manipulating HTML content outside the browser.
Readme
Dart CI pub package package publisher
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.
Changelog
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.
0.13.0
- BREAKING Fix all strong mode errors and warnings. This involved adding more precise types on some public APIs, which is why it may break users.
Pub version 0.12.2+2
- Support
csslibversions0.13.x.
Pub version 0.12.2+1
- Exclude
.packagesfile from the published package.
Pub version 0.12.2
- Added
Element.endSourceSpan, containing the span of a closing tag.
Pub version 0.12.0+1
- Support
csslibversion0.12.0.
Rename to package:html 0.12.0
- package has been renamed to
html
Pub version 0.12.0
- switch from
source_maps'Spanclass tosource_span'sSourceSpanclass.
Pub version 0.11.0+2
- expand the version constraint for csslib.
Pub version 0.10.0+1
- use a more recent source_maps version.
Pub version 0.10.0
- fix how document fragments are added in NodeList.add/addAll/insertAll.
Pub version 0.9.2-dev
- add Node.text, Node.append, Document.documentElement
- add Text.data, deprecate Node.value and Text.value.
- deprecate Node.$dom_nodeType
- added querySelector/querySelectorAll, deprecated query/queryAll. This matches the current APIs in dart:html.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add htmlpubspec.yaml
name: html
version: 0.15.4
description: APIs for parsing and manipulating HTML content outside the browser.
repository: https://github.com/dart-lang/html
topics:
- html
- web
environment:
sdk: '>=2.19.0 <4.0.0'
dependencies:
csslib: '>=0.17.0 <2.0.0'
source_span: ^1.8.0
dev_dependencies:
dart_flutter_team_lints: ^1.0.0
path: ^1.8.0
test: ^1.16.0
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.12.1 | 2015-03-05T17:09:20.587670Z | Download | 9d703adb8a0c5ac7c128d902fe7441b8eec622232fc447c1220bd384a1e588b6 |
| 0.12.1+1 | 2015-04-03T16:49:17.744980Z | Download | f45a0e612112669d4d985f4c6838cf4c8f23ed2e5f78eabecf1f8a17d19512c8 |
| 0.12.1+2 | 2015-07-06T18:34:13.252Z | Download | ecdd2bda0e403f8ad186ae44f4a3b359f82db85f9a0b35768cf856db3f329fe1 |
| 0.12.2 | 2015-08-28T20:15:52.148Z | Download | 3da7e4c5c7b5a771e7f91dd03efede395955054e3c0f99ecb4d6bd3c3b19f256 |
| 0.12.2+1 | 2015-12-17T01:35:30.122Z | Download | ba4a8ac6df5f9774733d4fe412598ca0edf858783ef83a1d2f2ffd1e55260ed6 |
| 0.12.2+2 | 2016-04-21T22:26:01.411Z | Download | 7712e2b66dc7e9317dca3345d01c87650cdb23aea6516403e0f9edeb8f80585c |
| 0.13.0 | 2016-05-11T23:17:21.760Z | Download | b4586242cfbe8a38653cab86591c8dd45805f559c666bd0dfc138fecf7e0edec |
| 0.13.1 | 2016-10-24T14:19:06.504Z | Download | 3df38f194934273d7aa6214ac017df0a61ee4c8cc42eb1fe1a6260370ad26eb3 |
| 0.13.2 | 2017-05-31T19:31:13.688587Z | Download | 49079e7b2de76cb370ded1c9264f508f3bc8701245a2922135550a8d534728b3 |
| 0.13.2+1 | 2017-12-22T00:36:10.098084Z | Download | 0388d00bc5fa31f106c3819268f88ec397084820b5cd0d202e17256d5d57bbac |
| 0.13.2+2 | 2018-01-09T18:06:46.360245Z | Download | bdc984d6a220bab1412371e887a4edb86b26c89d50a488793bdf4cfc6682b5f8 |
| 0.13.3-dev | 2018-03-10T00:41:14.974656Z | Download | 421139b9b5751cb3db7ef6de1dc73f07cb788b0b934303ca6c064599aa203e5b |
| 0.13.3 | 2018-03-10T00:43:39.168853Z | Download | 170bf947dc5d529bce3f0dfcfa3675c64ce41668eb66164d5b7b3450cc54f1b2 |
| 0.13.3+1 | 2018-05-30T15:58:52.959032Z | Download | 2ef9ea6aa7333ca9cffaf2243e12e2659b4d5ea841a16c883aef988925b09b37 |
| 0.13.3+2 | 2018-07-19T23:44:57.554313Z | Download | 541001dac7ad556b61e95a9b430f516fb9468c1969913394ab3ac93b016a9d37 |
| 0.13.3+3 | 2018-08-13T19:59:44.208935Z | Download | 4cace46b0dbcbb2cf22d353eb672a2cb80e2e881574e970b7ded20613200c4e8 |
| 0.13.4+1 | 2019-03-04T17:31:40.247026Z | Download | e33e6793cb2d0c6abe51e17f249184a30e64fba7df53da1a953b72cee6d1cf4d |
| 0.13.4+2 | 2019-04-11T01:10:18.105880Z | Download | 7da9d216cfd35679c53f73446304ea255b0df4991961ef2aadb07089ec6a87dc |
| 0.14.0 | 2019-04-09T00:18:58.004487Z | Download | cb8188cae01503d9aadd8dfce9faafc18e3057e879cfdffb6fe4f13c87162a41 |
| 0.14.0+1 | 2019-04-11T15:12:44.830700Z | Download | 8e32551aefe4632376e46c0194ddf0a39fb7e9e9da409dbc5f090a1bcafe435b |
| 0.14.0+2 | 2019-04-24T23:39:34.482292Z | Download | 4626ab4a13af7a29bf45b378f592fd142b3af015886610ac273688fd54c58588 |
| 0.14.0+3 | 2019-09-30T17:40:04.385868Z | Download | 820c300db9a6a9b7e5842bcbfb58c859e53f29d9fb4368c61aa19f8dafc36c92 |
| 0.14.0+4 | 2020-10-05T17:35:52.984710Z | Download | 49f0f00a6f85ecab782e641ad79377bfd4b4aea463178ac19cbf45ea8419c380 |
| 0.15.0-nullsafety.0 | 2021-02-01T18:12:07.903788Z | Download | a5ae9ba08db7fdaae5b7a1b98752a4d09805c2777b49e3f07e642a3eb046bdc8 |
| 0.15.0 | 2021-02-11T16:19:13.722662Z | Download | bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf |
| 0.15.1 | 2022-10-19T20:12:25.552211Z | Download | d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 |
| 0.15.2 | 2023-03-02T22:09:18.729383Z | Download | 79d498e6d6761925a34ee5ea8fa6dfef38607781d2fa91e37523474282af55cb |
| 0.15.3 | 2023-05-03T19:20:04.063658Z | Download | 58e3491f7bf0b6a4ea5110c0c688877460d1a6366731155c4a4580e7ded773e8 |
| 0.15.4 | 2023-06-08T15:49:40.750727Z | Download | 3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a |
| 0.15.5 | 2024-10-29T16:12:44.523258Z | Download | 1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec |
| 0.15.5+1 | 2025-04-08T16:38:53.252765Z | Download | 9475be233c437f0e3637af55e7702cbbe5c23a68bd56e8a5fa2d426297b7c6c8 |
| 0.15.6 | 2025-04-24T07:43:35.278305Z | Download | 6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602 |
| 0.15.7 | 2026-08-28T20:42:28.160706Z | Download | 43b67b8f43321ab066817dfac5619596c98bb1b61624e77203bb4351785f9699 |
Dependencies
csslib "\u003e=0.17.0 \u003c2.0.0"
source_span "^1.8.0"