Zola escapes HTML for standalone shortcode call but not for inline call

Hello!

Here is my shortcode assets.html:

{%- for asset in page.assets %}
{{ asset -}}
{% endfor %}

And this is the foo/first/index.md:

{{ assets() }}

Generated HTML:

foo/first/Flight_dive_by_Nicolas_Silva.png
foo/first/Ubuntu_80s_glitch_by_Abubakar_NK.jpg
foo/first/hardy_wallpaper_uhd.png

But now if I invoke the same shortcode inline then the forrward slash chars (/) don’t get escaped. Why is that?

shortcode call:

a{{ assets() }}

Generated HTML:

<p>afoo/first/Flight_dive_by_Nicolas_Silva.png
foo/first/Ubuntu_80s_glitch_by_Abubakar_NK.jpg
foo/first/hardy_wallpaper_uhd.png</p>

Thanks!

Also should this generated HTML have been enclosed in <p> tags like the one for inline shortcode call?

The whole shortcode logic probably needs some rewrite for 0.15, it’s confusing even me tbh

1 Like