XML prolog data being printed when including SVG in templateUrl
#34371
Labels
area: core
Issues related to the framework runtime
core: basic template syntax
cross-cutting: SVG
freq1: low
P4
A relatively minor issue that is not relevant to core functions
type: use-case
Milestone
🐞 Bug report
Command (mark with an
x
)Is this a regression?
NoDescription
Since v8 we have been able to reference SVG files in the `templateUrl` of a component. However, if the the SVG includes an XML declaration, Angular prints the declaration on the screen and then displays the SVG as expected. Since XML prolog data is valid in an SVG file, but not for inline SVG elements in html, I would expect the compiler to strip out all XML prolog data when compiling SVG files.🔬 Minimal Reproduction
svg.component.html
tosvg.component.svg
and replace contents with:templateUrl
insvg.component.ts
to be./svg.component.svg
<app-svg></app-svg>
element tag toapp.component.html
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
Same issue exists on 9.x release candidates.
Tested on Chrome and Safari (macOS)
Here is a StackBlitz repro: https://stackblitz.com/edit/angular-yvcjdp
The text was updated successfully, but these errors were encountered: