-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Error "unknown shortcode token" when calling shortcode within fenced code block #10819
Comments
I suspect the latter; or possibly also a subtle change in some of the Chroma lexers. ```bash
{{< sc >}}
``` The technical reasons why this fails is that some Chroma highlighters highlights the hyphen in the temporary placeholder, which doesn't work ... However, the above construct looks a little bit odd since the output of But we need to fix this anyway. |
Thanks @bep! I'll update the markup used in the Kubernetes docs. FWIW, it was hard to find this due to #10735.
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
N.B. I'm not sure if this is a bug, or if we've fixed a bug.
Reproducible with v0.111.0 and later.
If a shortcode is called using the
{{< >}}
notation within a fenced code block, Chroma lexes the placeholder, triggering an error such as:But this does not happen with all lexers, and may depend on where the shortcode is placed within the codeblock (not sure).
For example, this works:
But this throws an error:
And both of these work:
What the shortcode does is irrelevant (e.g., it can be empty).
Reference: https://discourse.gohugo.io/t/43387 (Kubernetes site)
Simple example:
The text was updated successfully, but these errors were encountered: