Broken rendering when using shortcodes inside code blocks
knadh opened this issue · comments
Bug Report
Environment
OS: Fedora 40
Zola version: v0.12.2
Expected Behavior
A shortcode that renders content inside a code block
(single or three backticks) should render the content correctly.
Current Behavior
Shortcodes that render content within code blocks render broken HTML with HTML-encoded <pre>
tags.
Raw HTML:
<code><pre data-shortcode>print("hello world")</pre></code>
Raw HTML:
<pre style="background-color:#1e1e1e;"><code><span style="color:#dcdcdc;"><pre data-shortcode>print(</span><span style="color:#d69d85;">"hello world"</span><span style="color:#dcdcdc;">)</pre>
</span></code></pre>
Step to reproduce
Create a shortcode file with any arbitrary content: templates/shortcodes/test.html
print("hello world")
Invoke it in a .md content file.
```python
{{ test }}
```
or
`{{ test }}`
Zola version: v0.12.2
Is that a typo?
Whoa, I somehow brain-farted and downloaded v0.12.2
instead of the latest v0.19.2
. This issue is not reproducible in v0.19.2
. Thanks for pointing out!