Go to file
Ayaz Hafiz 6ae3b68acf feat(compiler): Parse and recover on incomplete opening HTML tags (#38681)
Let's say we have a code like

```html
<div<span>123</span>
```

Currently this gets parsed into a tree with the element tag `div<span`.
This has at least two downsides:

- An incorrect diagnostic that `</span>` doesn't close an element is
  emitted.
- A consumer of the parse tree using it for editor services is unable to
  provide correct completions for the opening `<span>` tag.

This patch attempts to fix both issues by instead parsing the code into
the same tree that would be parsed for `<div></div><span>123</span>`.

In particular, we do this by optimistically scanning an open tag as
usual, but if we do not notice a terminating '>', we mark the tag as
"incomplete". A parser then emits an error for the incomplete tag and
adds a synthetic (recovered) element node to the tree with the
incomplete open tag's name.

What's the downside of this? For one, a breaking change.

<ol>
<li>

The first breaking change is that `<` symbols that are ambiguously text
or opening tags will be parsed as opening tags instead of text in
element bodies. Take the code

```html
<p>a<b</p>
```

Clearly we cannot have the best of both worlds, and this patch chooses
to swap the parsing strategy to support the new feature. Of course, `<`
can still be inserted as text via the `&lt;` entity.

</li>
</ol>

Part of #38596

PR Close #38681
2020-09-21 12:27:01 -07:00
.circleci fix(zone.js): add missing types field in package.json (#38585) 2020-09-11 08:43:53 -07:00
.devcontainer build: update the recommended `Dockerfile` for VSCode remote development (#34697) 2020-01-09 13:31:14 -08:00
.github ci: do not require g3 checks for the changes in `packages/zone.js/dist` folder (#38901) 2020-09-18 16:48:16 -07:00
.ng-dev build: add configuration for the caretaker command (#38601) 2020-09-01 13:05:32 -07:00
.vscode build: Ignore .history for the xyz.local-history VSCode extension (#38121) 2020-07-17 13:33:39 -07:00
.yarn build: update to latest version of yarn (#38869) 2020-09-18 16:47:33 -07:00
aio docs: change wrong default app module by ng new (#38549) 2020-09-21 12:25:28 -07:00
dev-infra feat(dev-infra): output the number of new and fixed cycles (#38805) 2020-09-18 11:20:08 -07:00
docs docs: add note about only one label target being allowed to be applied to a PR (#38764) 2020-09-10 08:53:47 -07:00
goldens fix(forms): type NG_VALUE_ACCESSOR injection token as array (#29723) 2020-09-21 12:26:07 -07:00
integration fix(bazel): fix integration test for bazel building (#38629) 2020-08-28 11:16:40 -07:00
modules refactor(dev-infra): ng_rollup_bundle rule should leverage `@bazel/rollup` (#37623) 2020-06-22 10:55:28 -07:00
packages feat(compiler): Parse and recover on incomplete opening HTML tags (#38681) 2020-09-21 12:27:01 -07:00
scripts style(dev-infra): enforce format on newly included files (#36940) 2020-06-12 15:06:41 -07:00
third_party build: move shims_for_IE to third_party directory (#37624) 2020-06-26 11:09:01 -07:00
tools build: create temporary script for symbol extractor tests (#38819) 2020-09-14 16:54:39 -07:00
.bazelignore build: add npm package manifest to npm_integration_test (#35669) 2020-02-26 12:58:35 -08:00
.bazelrc build: cleanup .bazelrc file to no longer set unused flags (#38124) 2020-08-03 12:53:11 -07:00
.bazelversion build: upgrade to bazel 3.2.0 and rules_nodejs 1.7.0 (#37358) 2020-06-08 09:15:50 -07:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.gitattributes test: fix ts api guardian and public guard tests on windows (#30105) 2019-04-26 16:32:22 -07:00
.gitignore feat(dev-infra): Add support for local user ng-dev configuration (#38701) 2020-09-09 16:31:16 -07:00
.gitmessage build: add .gitmessage file with commit message template (#37951) 2020-07-13 09:23:03 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: migrate to node@12.14.1 (#34955) 2020-01-27 09:31:22 -08:00
.pullapprove.yml fix(dev-infra): update i18n-related file locations in PullApprove config (#38403) 2020-08-10 17:29:51 -07:00
.yarnrc build: update to latest version of yarn (#38869) 2020-09-18 16:47:33 -07:00
BUILD.bazel docs(bazel): fix typo in BUILD.bazel comments (#38054) 2020-09-16 15:15:21 -07:00
CHANGELOG.md release: cut the v11.0.0-next.2 release 2020-09-16 14:52:51 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md refactor(dev-infra): remove `style` type from commit style guide (#38639) 2020-08-31 08:40:14 -07:00
LICENSE build: bump year (#34651) 2020-01-13 07:21:43 -08:00
README.md docs: remove browserstack badge from readme (#35684) 2020-03-17 09:29:43 -07:00
WORKSPACE build: upgrade to bazel 3.2.0 and rules_nodejs 1.7.0 (#37358) 2020-06-08 09:15:50 -07:00
browser-providers.conf.js build: run browsers tests on chromium locally (#38435) 2020-08-13 09:37:02 -07:00
gulpfile.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
karma-js.conf.js fix(core): detect DI parameters in JIT mode for downleveled ES2015 classes (#38463) 2020-08-17 10:55:37 -07:00
package.json release: cut the v11.0.0-next.2 release 2020-09-16 14:52:51 -07:00
test-events.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test-main.js build: import in-memory-web-api project (#37182) 2020-06-15 14:28:37 -07:00
tslint.json build: Update file-header lint rule to Google LLC (#37205) 2020-05-26 14:26:58 -04:00
yarn.lock feat(dev-infra): check services/status information of the repository for caretaker (#38601) 2020-09-01 13:05:30 -07:00
yarn.lock.readme.md build: remove travisci leftovers (#27979) 2019-01-09 10:41:16 -08:00

README.md

CircleCI Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Changelog

Learn about the latest improvements.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.