carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

Link: do not render `<p>` #1924

Closed theetrain closed 8 months ago

theetrain commented 8 months ago

Original report: https://github.com/carbon-design-system/carbon-components-svelte/discussions/1908#discussioncomment-8698373

Issue

Svelte 5 yields a compiler error for <Link> because <div> is an invalid descendent of <p>, which is correct as per W3 spec.

I recommend we align behaviour with Carbon React:

Reference:

https://github.com/carbon-design-system/carbon-components-svelte/blob/96aef1705cc2812d47a8015a1499a6c6021ced0f/src/Link/Link.svelte#L37-L60

Reproduction

Demo: https://stackblitz.com/edit/sveltejs-kit-template-default-mxnwjf?file=src%2Froutes%2F%2Bpage.svelte

Screenshot:

image
metonym commented 8 months ago

Yes, I think it makes sense to fix this for <v1 if it's blocking Svelte 5 usage.

theetrain commented 8 months ago

Fix was released in v0.83.0.