Open mellunar opened 1 month ago
Please provide a minimal reproduction in the form of a downloadable repository. Otherwise, I’m inclined to think this is an issue with how browsers handle anchor tags nested in other anchor tags. A similar issue to this is https://github.com/withastro/astro/issues/4864
It is not a browser issues, this is just invalid according to the spec.
Content model: Transparent, but there must be no interactive content descendant, a element descendant, or descendant with the tabindex attribute specified.
Describe the bug
When building the code to production, Sveltekit is not rendering the code as it's supposed to be.
This is how my code looks like in editor:![sveltekit1](https://github.com/sveltejs/kit/assets/87154023/d9a8b271-6781-4fc2-96bf-0c9ad24a9f83)
When previewing it with 'npm run dev', it renders the code properly:![sveltekit2](https://github.com/sveltejs/kit/assets/87154023/dd826160-c8d5-4b1d-abb5-adf44426231f)
But after building it to production, this is how it's rendered into view:![sveltekit3](https://github.com/sveltejs/kit/assets/87154023/d8313131-8acf-47fa-8a82-b201ac5668b1)
In the last picture, the div is outside the anchor tag, causing the layout to be broken, and another anchor tag is created inside it.
Reproduction
Create a project, add an anchor tag on a page, then insert content into a div inside it, and build/preview the project.
Logs
No response
System Info
Severity
annoyance
Additional Information
No response