Markdown links in HTML embedded code

234 views Asked by At

I want to introduce markdown links to other markdown documents. However, those links are within HTML tags. An example:

<dl class="section note">
    <dt>Note</dt>
    <dd>This is a Note, [link](path/to/file.md).</dd>
</dl>

Since the link is already inside HTML code, it is shown as is. Is there any way to do this?

NOTE: I am using Pelican static site generator.

Thank you!

1

There are 1 answers

2
Kyle Barbour On

There isn't a way to do this in vanilla Markdown. If you're able to use the kramdown parser, you can do this by adding markdown="span" to the tags which need processing:

<dl class="section note">
    <dt>Note</dt>
    <dd markdown="span">This is a Note, [link](path/to/file.md).</dd>
</dl>

This produces the output:

<dl class="section note">
    <dt>Note</dt>
    <dd>This is a Note, <a href="path/to/file.md">link</a>.</dd>
</dl>

More details in the kramdown syntax manual.