Definition list are broken with several definitions and block elements
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.2k
- Forks
- 1.9k
- PR merge metrics
- PR metrics pending
Description
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.4
And the current main branch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/mdbook-html/front-end/css/general.css at the linked display:flex rule, then reproduce the Markdown example from the issue in mdBook. Compare single and multiple definitions containing block elements; done means both render correctly without requiring the workaround described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, html
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100