Markdown Reference Links Stop Working with Markdown Extra and Nested Markdown

I have Markdown Extra enabled, but when I try to nest markdown in block elements, reference links stop working.

For example, if you take Kirby Starterkit and the following to the config file:

c::set('markdown.extra', true);

and then make the Home.txt file resemble:

Title: Home


Intro: Yay! If you are seeing this, the installation of Kirby worked. :-)




This is an [example][foo]. Another [example](

## Get started

<div markdown="1">
- Go to the (link: panel text: Panel) to give Kirby's admin interface a try
- Check out the (link: text: docs) and start building your own site
- Follow (twitter: @getkirby) on Twitter for updates
- Visit the (link: text: forum) to connect with other Kirby users
- Sign up to (link: text: Kirby Kosmos), our monthly newsletter
- (link: text: Get in contact) if you need support.

**Have fun with Kirby!**

then you’ll have an output that looks like:

If you were to change markdown="1" to markdown="0" then the reference link will work again, but (obviously) the Markdown list within the <div> element will not work.

Is this a bug, or am I missing some subtle error on my part?

Interestingly, it works if you put the reference at the end.

I suspect this is an issue related to ParsedownExtra, the MarkdownExtra parser used by Kirby.

Yep, you’re totally right. I tested on and can confirm.

I filed an issue there:

Thanks for the workaround!