Kotlin / kotlinx.html

Kotlin DSL for HTML
Apache License 2.0
1.63k stars 133 forks source link

DT tag should allow more child types (should not be `PhrasingContent`) #217

Open owengray-google opened 1 year ago

owengray-google commented 1 year ago

According to the HTML spec (https://html.spec.whatwg.org/#the-dt-element), the dt element is "Categories: None" and "Content model: Flow content, but with no header, footer, sectioning content, or heading content descendants."
However, in kotlinx.html, dt is HtmlInlineTag, which is PhrasingContent, meaning it only supports children that can exist in PhrasingContent contexts.

This can currently be worked around with unsafe, but that should not be necessary.

(Conceptually, Phrasing content is a subset of Flow content, and there are things (like dt) that don't match any of the content types--I think there is an issue with the overall hierarchy, but that is beyond the scope of this bug.)