🐞 bug report
Affected Package
The issue is caused by package @angular/compiler.
Is this a regression?
No.
Description
Context: prettier#14, prettier/prettier#8210
According to the HTML spec:
The attribute name, followed by zero or more ASCII whitespace, followed by a single U+003D EQUALS SIGN character, followed by zero or more ASCII whitespace, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal ASCII whitespace, any U+0022 QUOTATION MARK characters ("), U+0027 APOSTROPHE characters ('), U+003D EQUALS SIGN characters (=), U+003C LESS-THAN SIGN characters (<), U+003E GREATER-THAN SIGN characters (>), or U+0060 GRAVE ACCENT characters (`), and must not be the empty string.
U+002F SLASH characters (/) are valid unquoted attribute values, but the parser treat them as end signals:
|
this._beginToken(TokenType.ATTR_VALUE); |
|
const valueStart = this._cursor.clone(); |
|
this._requireCharCodeUntilFn(isNameEnd, 1); |
|
value = this._cursor.getChars(valueStart); |
|
this._endToken([this._processCarriageReturns(value)]); |
|
function isNameEnd(code: number): boolean { |
|
return chars.isWhitespace(code) || code === chars.$GT || code === chars.$SLASH || |
|
code === chars.$SQ || code === chars.$DQ || code === chars.$EQ; |
|
} |
🔬 Minimal Reproduction
const {parseTemplate} = require("@angular/compiler");
const ast = parseTemplate("<a href=https://angular.io/>Link</a>");
console.log(ast.errors); //=> Unexpected closing tag "a".
🔥 Exception or Error
Unexpected closing tag "a". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags
🌍 Your Environment
Angular Version:
Anything else relevant?
No.
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler.Is this a regression?
No.Description
Context: prettier#14, prettier/prettier#8210
According to the HTML spec:
U+002F SLASH characters (/) are valid unquoted attribute values, but the parser treat them as end signals:
angular/packages/compiler/src/ml_parser/lexer.ts
Lines 595 to 599 in 42c58d9
angular/packages/compiler/src/ml_parser/lexer.ts
Lines 761 to 764 in 42c58d9
🔬 Minimal Reproduction
🔥 Exception or Error
Unexpected closing tag "a". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags
🌍 Your Environment
Angular Version:
Anything else relevant?
No.