Skip to content

HTML select element cannot contain hr elements #11342

@kran6a

Description

@kran6a

Describe the bug

The following WHATWG-spec-compliant code causes an error in Svelte 5 but not in Svelte 4

<select>
    <option value="0">The</option>
     <hr>
    <option value="1">bug</option>
</select>

Thre is even an example of using hr as an separator in https://html.spec.whatwg.org/#the-select-element:
image

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACnWNvQqDMBhFX-XjzgHbNaSBvkO3poPVzxqISciPUMR3L6KDS8d7uIezYLCOM-RzgW8nhsQ9RgiUb9xGntkVhkAONXUbUZkdd0UbT0SkQiw2eJpbV_lmcDHQj5FVs_PjRWpMf4SrgX7Xz0lQzVGAwBR6O1juIUuqvL7WH49vgSKwAAAA

Logs

<hr> is invalid inside <select>

System Info

Does not matter

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions