According to MDN, a <dl> is permitted to be child of an element that accepts flow content. <p> is itself an element in the "flow content" category, and only permits children which are phrasing content, which does not include <dl>
Why is this a problem?
When the browser sees this HTML structure it rewrites it. It's easier to show you.
Given this HTML: (such as that generated by remark-deflist)
According to MDN, a
<dl>
is permitted to be child of an element that accepts flow content.<p>
is itself an element in the "flow content" category, and only permits children which are phrasing content, which does not include<dl>
Why is this a problem?
When the browser sees this HTML structure it rewrites it. It's easier to show you.
Given this HTML: (such as that generated by remark-deflist)
it results in the following DOM:
ALT:
Given my
<p>
elements have margin this adds an unusual margin before the<dl>
, that is difficult to fix with CSS.