Skip to content
Grav 2.0 is officially stable. Read the announcement →
Content & Markdown

Definition lists in Markdown extra not working

Solved by Gez View solution

Started by Jochen 10 months ago · 6 replies · 725 views
10 months ago

I’m a new user and still learning. I’m trying to use a definition list, i.e.
<dl><dt>Apple</dt><dd>Pomaceous fruit…</dd></dl>

Embedding this as raw html does work.

According to https://michelf.ca/projects/php-markdown/extra/ , there is a Markdown syntax to achieve this, but this doesn’t work for me:

TXT
Apple
:   Pomaceous fruit of plants of the genus Malus in
    the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

This simply renders as

HTML
<p>Apple
:   Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</p>
<p>Orange
:   The fruit of an evergreen tree of the genus Citrus.</p>

I have enabled Markdown Extra in system.yaml:

YAML
pages:
  markdown:
    extra: true

Am I doing something wrong, or are definition lists simply not implemented in Grav? It’s not a terrible problem to write them as embedded html, but it’s a bit tedious. The Markdown syntax would be simpler.

10 months ago

it looks "pre" tag is better for that to me

10 months ago

The intended outcome is something like this:

Bildschirmfoto 2025-10-31 um 18.36.17|690x188

10 months ago Solution

i just created a new page named test and write this

TXT
Apple
: Pomaceous fruit of plants of the genus Malus in 
  the family Rosaceae.
: An American computer company.

Orange
: The fruit of an evergreen tree of the genus Citrus.

and save page

and went to configurations and clicked yes for markdown extra

when i reload test page i see this at source

TXT
<dl>
<dt>Apple</dt>
<dd>Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</dd>
<dd>An American computer company.</dd>
<dt>Orange</dt>
<dd>The fruit of an evergreen tree of the genus Citrus.</dd>
</dl>

ss is this
resim|526x104

to make dt bold we can use css and while we are at it we can increase line height etc.

Ugh.. i just realized i used apple as an example... i dont like it much actually since it is closed source...

👍 1
10 months ago

Thanks for checking that. I’ll have another look, I currently use the config files not the admin plugin to set enable markdown extra, maybe this is not working for some reason.

10 months ago

Indeed it works for me now. I had overlooked a second place in system.yaml setting markdown: extra: false, which apparently took precedence. Thanks again for sending me in the right direction!

👍 1
10 months ago

your wellcome ^^
click solution pls :)

👍 1

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Ton Haarmans, 1 year ago
10 624 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 546 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 471 1 year ago
Content & Markdown · by belthasar, 2 years ago
4 816 2 years ago
Content & Markdown · by David Schad, 2 years ago
2 406 2 years ago