Possible shortcode bug when using an email address

I’ve spent a few hours trying to fix this but no luck.

In content/post.md, I have the following shortcode:

{{< post/email >}}

In layouts/shortcodes/post:

<a class="text-gray-600 font-medium" href="mailto:myemail@email.com">myemail@email.com</a>

In layouts/post/list.html:


This renders:

<a class="text-gray-600 font-medium" href="mailto:myemail@email.com"></a>
<a href="mailto:myemail@email.com">mailto:myemail@email.com</a>

And the class styling is not applied.

The behavior I would expect is this to render:

<a class="text-gray-600 font-medium" href="mailto:myemail@email.com">myemail@email.com</a>

If I remove the email address and replace it with ‘contact me’ it works correctly.

<a class="text-gray-600 font-medium" href="mailto:myemail@email.com">contact me</a>

What am I doing wrong?

Also, in config.toml, I have

  unsafe = true

.Content value already processed by Markdown processor, no need to pipe it again with markdownify function.

Yes, that’s true. Thanks for pointing that out. I’ve edited my post.

try disable linkify extension

++      linkify = false

That worked! Thanks for helping out. :raised_hands:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.