Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

Definition lists in Markdown extra not working

Solved by Gez View solution

Started by Jochen 12 months ago · 6 replies · 1293 views
12 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.

12 months ago

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

12 months ago

The intended outcome is something like this:

Bildschirmfoto 2025-10-31 um 18.36.17|690x188

12 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
12 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.

12 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
12 months ago

your wellcome ^^
click solution pls :)

👍 1

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Ton Haarmans, 2 years ago
10 1019 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 891 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 821 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1235 2 years ago
Content & Markdown · by David Schad, 2 years ago
2 718 2 years ago