Astro Info
Astro v4.4.1
Node v20.11.1
System Linux (x64)
Package Manager npm
Output static
Adapter none
Integrations none
If this issue only occurs in one browser, which browser is a problem?
n/a
Describe the Bug
Astro fails to parse a elements within template elements correctly in certain situations.
If the content of the a element is an expression, Astro emits the a element again after the template element.
The following is not handled correctly:
<template>
<a href="https://example.com">{text}</a>.
</template>
<p>Some text</p>
The emitted HTML is equivalent to the following:
<template>
<a href="https://example.com">Text</a>.
</template>
<a href="https://example.com">
<p>Some text</p>
</a>
This problem does not occur if the a Element only contains plain text (i.e. not an expression).
What's the expected result?
Astro should parse/emit a elements within template elements correctly.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-5amjgj?file=src%2Fpages%2Findex.astro
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
n/a
Describe the Bug
Astro fails to parse
aelements withintemplateelements correctly in certain situations.If the content of the
aelement is an expression, Astro emits theaelement again after the template element.The following is not handled correctly:
The emitted HTML is equivalent to the following:
This problem does not occur if the
aElement only contains plain text (i.e. not an expression).What's the expected result?
Astro should parse/emit
aelements withintemplateelements correctly.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-5amjgj?file=src%2Fpages%2Findex.astro
Participation