diff --git a/.github/ISSUE_TEMPLATE/html.md b/.github/ISSUE_TEMPLATE/html.md new file mode 100644 index 000000000..ec1e01d85 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/html.md @@ -0,0 +1,5 @@ +--- +name: "package:html" +about: "Create a bug or file a feature request against package:html." +labels: "package:html" +--- \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml index 91184961c..3f56dafac 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -60,6 +60,10 @@ - changed-files: - any-glob-to-any-file: 'pkgs/graphs/**' +'package:html': + - changed-files: + - any-glob-to-any-file: 'pkgs/html/**' + 'package:json_rpc_2': - changed-files: - any-glob-to-any-file: 'pkgs/json_rpc_2/**' diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml new file mode 100644 index 000000000..fe75a0dfb --- /dev/null +++ b/.github/workflows/html.yaml @@ -0,0 +1,61 @@ +name: package:html + +on: + # Run on PRs and pushes to the default branch. + push: + branches: [ main ] + paths: + - '.github/workflows/html.yml' + - 'pkgs/html/**' + pull_request: + branches: [ main ] + paths: + - '.github/workflows/html.yml' + - 'pkgs/html/**' + schedule: + - cron: "0 0 * * 0" + +env: + PUB_ENVIRONMENT: bot.github + + +defaults: + run: + working-directory: pkgs/html/ + +jobs: + analyze: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: install + run: dart pub get + - run: dart format --output=none --set-exit-if-changed . + if: steps.install.outcome == 'success' + - run: dart analyze --fatal-infos + if: steps.install.outcome == 'success' + + test: + needs: analyze + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + sdk: [3.2, stable, dev] + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: ${{ matrix.sdk }} + - id: install + run: dart pub get + - run: dart test --platform vm + if: steps.install.outcome == 'success' + - run: dart test --platform chrome + if: steps.install.outcome == 'success' diff --git a/README.md b/README.md index dc8401823..868a71088 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ don't naturally belong to other topic monorepos (like | [file](pkgs/file/) | A pluggable, mockable file system abstraction for Dart. | [![pub package](https://img.shields.io/pub/v/file.svg)](https://pub.dev/packages/file) | | [file_testing](pkgs/file_testing/) | Testing utilities for package:file (published but unlisted). | [![pub package](https://img.shields.io/pub/v/file_testing.svg)](https://pub.dev/packages/file_testing) | | [graphs](pkgs/graphs/) | Graph algorithms that operate on graphs in any representation | [![pub package](https://img.shields.io/pub/v/graphs.svg)](https://pub.dev/packages/graphs) | +| [html](pkgs/html/) | APIs for parsing and manipulating HTML content outside the browser. | [![pub package](https://img.shields.io/pub/v/html.svg)](https://pub.dev/packages/html) | | [json_rpc_2](pkgs/json_rpc_2/) | Utilities to write a client or server using the JSON-RPC 2.0 spec. | [![pub package](https://img.shields.io/pub/v/json_rpc_2.svg)](https://pub.dev/packages/json_rpc_2) | | [mime](pkgs/mime/) | Utilities for handling media (MIME) types. | [![pub package](https://img.shields.io/pub/v/mime.svg)](https://pub.dev/packages/mime) | | [oauth2](pkgs/oauth2/) | A client library for authenticatingand making requests via OAuth2. | [![pub package](https://img.shields.io/pub/v/oauth2.svg)](https://pub.dev/packages/oauth2) | diff --git a/pkgs/html/.gitignore b/pkgs/html/.gitignore new file mode 100644 index 000000000..3ab3a4493 --- /dev/null +++ b/pkgs/html/.gitignore @@ -0,0 +1,19 @@ +# Don’t commit the following directories created by pub. +.pub +.dart_tool/ +build/ +packages +.packages + +# Or the files created by dart2js. +*.dart.js +*.dart.precompiled.js +*.js_ +*.js.deps +*.js.map +*.sw? +.idea/ +.pub/ + +# Include when developing application packages. +pubspec.lock diff --git a/pkgs/html/CHANGELOG.md b/pkgs/html/CHANGELOG.md new file mode 100644 index 000000000..9a881e9d7 --- /dev/null +++ b/pkgs/html/CHANGELOG.md @@ -0,0 +1,149 @@ +## 0.15.5 + +- Require Dart `3.2`. +- Move to `dart-lang/tools` monorepo. + +## 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.dart` and others). +- Adopted the `package:dart_flutter_team_lints` linting rules. +- Fixed an issue with `querySelector` where it would fail in some cases with + descendant or sibling combinators (#157). +- Add an API example in `example/`. + +## 0.15.1 + +- Move `htmlSerializeEscape` to its own library, + `package:html/html_escape.dart`, which is exported from + `package:html/dom_parsing.dart`. +- Use more non-growable lists, and type annotations on List literals. +- Switch analysis option `implicit-casts: false` to `strict-casts: true`. + +## 0.15.0 + +- Migrate to null safety. +- Drop `lastPhase`, `beforeRcDataPhase`, and `container` fields from + `HtmlParser` class. These fields never had a value other than `null`. + +## 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.dart` library. + +## 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 `processStartTag` and `processEndTag` + methods. + +## 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.indexOf` and + `FilteredElementList.lastIndexOf` to include type annotations. + +## 0.13.2+2 + + * Update signature for implementations of `Iterable.singleWhere` to include + optional argument. + +## 0.13.2+1 + + * Changed the implementation of `Set` and `List` classes to use base classes + from `dart:collection`. + +## 0.13.2 + + * Support the latest release of `pkg/csslib`. + +## 0.13.1 + * Update Set.difference to take a Set
+#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end tag (strong) in table context caused voodoo mode. +Line: 1 Col: 20 End tag (strong) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 24 Unexpected end tag (b) in table context caused voodoo mode. +Line: 1 Col: 24 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 29 Unexpected end tag (em) in table context caused voodoo mode. +Line: 1 Col: 29 End tag (em) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 33 Unexpected end tag (i) in table context caused voodoo mode. +Line: 1 Col: 33 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 37 Unexpected end tag (u) in table context caused voodoo mode. +Line: 1 Col: 37 End tag (u) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 46 Unexpected end tag (strike) in table context caused voodoo mode. +Line: 1 Col: 46 End tag (strike) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 50 Unexpected end tag (s) in table context caused voodoo mode. +Line: 1 Col: 50 End tag (s) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 58 Unexpected end tag (blink) in table context caused voodoo mode. +Line: 1 Col: 58 Unexpected end tag (blink). Ignored. +Line: 1 Col: 63 Unexpected end tag (tt) in table context caused voodoo mode. +Line: 1 Col: 63 End tag (tt) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 69 Unexpected end tag (pre) in table context caused voodoo mode. +Line: 1 Col: 69 End tag (pre) seen too early. Expected other end tag. +Line: 1 Col: 75 Unexpected end tag (big) in table context caused voodoo mode. +Line: 1 Col: 75 End tag (big) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 83 Unexpected end tag (small) in table context caused voodoo mode. +Line: 1 Col: 83 End tag (small) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 90 Unexpected end tag (font) in table context caused voodoo mode. +Line: 1 Col: 90 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 99 Unexpected end tag (select) in table context caused voodoo mode. +Line: 1 Col: 99 Unexpected end tag (select). Ignored. +Line: 1 Col: 104 Unexpected end tag (h1) in table context caused voodoo mode. +Line: 1 Col: 104 End tag (h1) seen too early. Expected other end tag. +Line: 1 Col: 109 Unexpected end tag (h2) in table context caused voodoo mode. +Line: 1 Col: 109 End tag (h2) seen too early. Expected other end tag. +Line: 1 Col: 114 Unexpected end tag (h3) in table context caused voodoo mode. +Line: 1 Col: 114 End tag (h3) seen too early. Expected other end tag. +Line: 1 Col: 119 Unexpected end tag (h4) in table context caused voodoo mode. +Line: 1 Col: 119 End tag (h4) seen too early. Expected other end tag. +Line: 1 Col: 124 Unexpected end tag (h5) in table context caused voodoo mode. +Line: 1 Col: 124 End tag (h5) seen too early. Expected other end tag. +Line: 1 Col: 129 Unexpected end tag (h6) in table context caused voodoo mode. +Line: 1 Col: 129 End tag (h6) seen too early. Expected other end tag. +Line: 1 Col: 136 Unexpected end tag (body) in the table row phase. Ignored. +Line: 1 Col: 141 Unexpected end tag (br) in table context caused voodoo mode. +Line: 1 Col: 141 Unexpected end tag (br). Treated as br element. +Line: 1 Col: 145 Unexpected end tag (a) in table context caused voodoo mode. +Line: 1 Col: 145 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 151 Unexpected end tag (img) in table context caused voodoo mode. +Line: 1 Col: 151 This element (img) has no end tag. +Line: 1 Col: 159 Unexpected end tag (title) in table context caused voodoo mode. +Line: 1 Col: 159 Unexpected end tag (title). Ignored. +Line: 1 Col: 166 Unexpected end tag (span) in table context caused voodoo mode. +Line: 1 Col: 166 Unexpected end tag (span). Ignored. +Line: 1 Col: 174 Unexpected end tag (style) in table context caused voodoo mode. +Line: 1 Col: 174 Unexpected end tag (style). Ignored. +Line: 1 Col: 183 Unexpected end tag (script) in table context caused voodoo mode. +Line: 1 Col: 183 Unexpected end tag (script). Ignored. +Line: 1 Col: 196 Unexpected end tag (th). Ignored. +Line: 1 Col: 201 Unexpected end tag (td). Ignored. +Line: 1 Col: 206 Unexpected end tag (tr). Ignored. +Line: 1 Col: 214 This element (frame) has no end tag. +Line: 1 Col: 221 This element (area) has no end tag. +Line: 1 Col: 228 Unexpected end tag (link). Ignored. +Line: 1 Col: 236 This element (param) has no end tag. +Line: 1 Col: 241 This element (hr) has no end tag. +Line: 1 Col: 249 This element (input) has no end tag. +Line: 1 Col: 255 Unexpected end tag (col). Ignored. +Line: 1 Col: 262 Unexpected end tag (base). Ignored. +Line: 1 Col: 269 Unexpected end tag (meta). Ignored. +Line: 1 Col: 280 This element (basefont) has no end tag. +Line: 1 Col: 290 This element (bgsound) has no end tag. +Line: 1 Col: 298 This element (embed) has no end tag. +Line: 1 Col: 307 This element (spacer) has no end tag. +Line: 1 Col: 311 Unexpected end tag (p). Ignored. +Line: 1 Col: 316 End tag (dd) seen too early. Expected other end tag. +Line: 1 Col: 321 End tag (dt) seen too early. Expected other end tag. +Line: 1 Col: 331 Unexpected end tag (caption). Ignored. +Line: 1 Col: 342 Unexpected end tag (colgroup). Ignored. +Line: 1 Col: 350 Unexpected end tag (tbody). Ignored. +Line: 1 Col: 358 Unexpected end tag (tfoot). Ignored. +Line: 1 Col: 366 Unexpected end tag (thead). Ignored. +Line: 1 Col: 376 End tag (address) seen too early. Expected other end tag. +Line: 1 Col: 389 End tag (blockquote) seen too early. Expected other end tag. +Line: 1 Col: 398 End tag (center) seen too early. Expected other end tag. +Line: 1 Col: 404 Unexpected end tag (dir). Ignored. +Line: 1 Col: 410 End tag (div) seen too early. Expected other end tag. +Line: 1 Col: 415 End tag (dl) seen too early. Expected other end tag. +Line: 1 Col: 426 End tag (fieldset) seen too early. Expected other end tag. +Line: 1 Col: 436 End tag (listing) seen too early. Expected other end tag. +Line: 1 Col: 443 End tag (menu) seen too early. Expected other end tag. +Line: 1 Col: 448 End tag (ol) seen too early. Expected other end tag. +Line: 1 Col: 453 End tag (ul) seen too early. Expected other end tag. +Line: 1 Col: 458 End tag (li) seen too early. Expected other end tag. +Line: 1 Col: 465 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 471 This element (wbr) has no end tag. +Line: 1 Col: 487 End tag (button) seen too early. Expected other end tag. +Line: 1 Col: 497 End tag (marquee) seen too early. Expected other end tag. +Line: 1 Col: 506 End tag (object) seen too early. Expected other end tag. +Line: 1 Col: 524 Unexpected end tag (html). Ignored. +Line: 1 Col: 524 Unexpected end tag (frameset). Ignored. +Line: 1 Col: 531 Unexpected end tag (head). Ignored. +Line: 1 Col: 540 Unexpected end tag (iframe). Ignored. +Line: 1 Col: 548 This element (image) has no end tag. +Line: 1 Col: 558 This element (isindex) has no end tag. +Line: 1 Col: 568 Unexpected end tag (noembed). Ignored. +Line: 1 Col: 579 Unexpected end tag (noframes). Ignored. +Line: 1 Col: 590 Unexpected end tag (noscript). Ignored. +Line: 1 Col: 601 Unexpected end tag (optgroup). Ignored. +Line: 1 Col: 610 Unexpected end tag (option). Ignored. +Line: 1 Col: 622 Unexpected end tag (plaintext). Ignored. +Line: 1 Col: 633 Unexpected end tag (textarea). Ignored. +#document +| +| +| +|