Definition list are broken with several definitions and block elements
Author: pinage404Created Sep 9, 2026Updated Sep 9, 2026
LabelsC-bug
Hello,
Problem
When adding block elements (<ul>, <blockquote>, <dl>...) in a definition (<dd>) the render is good, unless having several definitions
# Example
Single definition
: a definition with some block elements
> This is a blockquote
* This is an item of unordered list
* Another item
Nested definition term
: foo
: bar
Several definitions
: the same definition as above list with some block elements
> This is a blockquote
* This is an item of unordered list
* Another item
Nested definition term
: foo
: bar
: but with another definition
Several definitions "fixed" with a `<div>`
: <div>the same definition as above list with some block elements wrapped in a <code><div></code>
> This is a blockquote
* This is an item of unordered list
* Another item
Nested definition term
: foo
: bar
</div>
: but with another definition
Steps
- use a definition list
- add block elements in the definition
- add another definitions
Possible Solution(s)
It is caused by this display: flex
- maybe the CSS can be changed (i think, it's preferable)
- maybe a
<div>can wrap the content of the<dd>
Notes
Also, i would recommend wrapping definitions (<dl> + <dd>) in <div>, it is easier to add custom style
<dl>
<div>
<dt>Term 1</dt>
<dd>Definition</dd>
</div>
<div>
<dt>Term 2</dt>
<dd>Definition 1</dd>
<dd>Definition 2</dd>
</div>
</dl>Version
0.5.4And the current main branch
Source: rust-lang/mdBook