-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for shortcodes in fenced code blocks #1708
Comments
Hm I didn't think anyone was using shortcodes in code blocks... I believe for now you can fix it by not using a markdown code block:
(or whatever combination of |
This doesn't appear to work – instead, it renders the shortcode within the |
ah yes it will not be escaped... I guess it needs to handle shortcodes in codeblocks too. If anyone wants to try, it should be self-contained to |
But it's interesting idea, isn't it?! I'd definitely like to see this working too, please. |
I think this issue could be closed now? It's been fixed in #1720. |
I usually close on release to avoid duplicate issues. I put the Done tag to try to remember to close it at that point ;) |
Fixed in release 0.15.3! What a great community we've got here - thanks everyone for the quick patch. |
This still appears to be happening for me with zola 0.17.2
Results in
Update: Hmm, perhaps this is actually working as intended. In my case, I just want to display the literal text, not trigger a shortcode. Is there a way for me to escape this so that I just get the literal Update 2: 🤦 it's right there in the docs
Sorry for the noise, please ignore this comment. |
It does not happen only in code blocks. I used to have
where |
Bug Report
Environment
Zola version: 0.15.2
Expected Behavior
Tell us what should have happened.
In previous versions of Zola, I was able to put shortcodes in fenced code blocks in order to give the viewer an idea of what the generated HTML of the shortcode would look like when used.
This is useful, for example, when giving examples of custom shortcodes in Zola themes.
Current Behavior
Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding
RUST_BACKTRACE=1
when running azola
command.In the current version of Zola, these shortcodes just output
@@ZOLA_SC_PLACEHOLDER@@
.Step to reproduce
Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample
that triggers the bug.
To view this in action, clone figbert/d3c3nt and run
zola serve
in the root directory. From there, navigate to/posts/rich-content/
and scroll around.The text was updated successfully, but these errors were encountered: