-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/build): support valid self-closing MathML tags in HTML i…
…ndex file Prior to this change, the Angular build process incorrectly flagged self-closing MathML tags (e.g., `<msqrt />`) as invalid HTML. This commit rectifies this issue by explicitly allowing self-closing syntax for MathML elements embedded within the HTML index file.
- Loading branch information
1 parent
5f9053a
commit c33629e
Showing
2 changed files
with
60 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/angular/build/src/utils/index-file/valid-self-closing-tags.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
/** A list of valid self closing HTML elements */ | ||
export const VALID_SELF_CLOSING_TAGS = new Set([ | ||
'area', | ||
'base', | ||
'br', | ||
'col', | ||
'embed', | ||
'hr', | ||
'img', | ||
'input', | ||
'link', | ||
'meta', | ||
'param', | ||
'source', | ||
'track', | ||
'wbr', | ||
/** SVG tags */ | ||
'circle', | ||
'ellipse', | ||
'line', | ||
'path', | ||
'polygon', | ||
'polyline', | ||
'rect', | ||
'text', | ||
'tspan', | ||
'linearGradient', | ||
'radialGradient', | ||
'stop', | ||
'image', | ||
'pattern', | ||
'defs', | ||
'g', | ||
'marker', | ||
'mask', | ||
'style', | ||
'symbol', | ||
'use', | ||
'view', | ||
/** MathML tags */ | ||
'mspace', | ||
'mphantom', | ||
'mrow', | ||
'mfrac', | ||
'msqrt', | ||
'mroot', | ||
'mstyle', | ||
'merror', | ||
'mpadded', | ||
'mtable', | ||
]); |