From 5f9053a05911a9ffc1433078b980b20f52c38b58 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 23 May 2024 15:43:37 +0000 Subject: [PATCH] fix(@angular/build): support valid self-closing SVG tags in HTML index file Prior to this change, the Angular build process incorrectly flagged self-closing SVG tags (e.g., ``) as invalid HTML. This commit rectifies this issue by explicitly allowing self-closing syntax for SVG elements embedded within the HTML index file. Closes: #27702 --- .../utils/index-file/augment-index-html.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/angular/build/src/utils/index-file/augment-index-html.ts b/packages/angular/build/src/utils/index-file/augment-index-html.ts index 4c9f5fe16918..a52c5425eda7 100644 --- a/packages/angular/build/src/utils/index-file/augment-index-html.ts +++ b/packages/angular/build/src/utils/index-file/augment-index-html.ts @@ -65,6 +65,29 @@ const VALID_SELF_CLOSING_TAGS = new Set([ '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', ]); /*