-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Markdown code block within fully rendered shortcode should not be parsed for HTML syntax errors #9821
Comments
Confirmed. This has been an issue since at least v0.54.0 (I didn't test anything earlier). Simplied example... layouts/shortcodes/foo.html
markdown
|
This error occurs when layouts/shortcodes/foo.md
|
A temporary fix is using safeHTML function: layouts/shortcodes/foo.md
|
This smells like an upstream issue that someone needs to raise at https://github.com/golang/go/issues/ layouts/shortcodes/foo.md
{{ safeHTML "<" }}o You can also create a new output format for This will use Go's text (not HTML) parser. EDIT: Thinking about it, I'm not totally sure that the above would work, but I'll think about it. |
I have tested the above, and that works fine. I added a PR in #9940 which I need to think a little about whether is a great idea. But in any case, you can define this output format in your site config in the existing Hugo versions and it should work. |
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual. This is mainly meant for shortcodes that produces Markdown to be inlined. You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`). This output format is defined as plain text, and will use Go's much more lenient text template parser. Updates gohugoio#9821
Would it be possible to set |
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual. This is mainly meant for shortcodes that produces Markdown to be inlined. You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`). This output format is defined as plain text, and will use Go's much more lenient text template parser. Updates gohugoio#9821
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual. This is mainly meant for shortcodes that produces Markdown to be inlined. You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`). This output format is defined as plain text, and will use Go's much more lenient text template parser. Updates gohugoio#9821
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual. This is mainly meant for shortcodes that produces Markdown to be inlined. You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`). This output format is defined as plain text, and will use Go's much more lenient text template parser. Updates gohugoio#9821
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual. This is mainly meant for shortcodes that produces Markdown to be inlined. You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`). This output format is defined as plain text, and will use Go's much more lenient text template parser. Updates gohugoio#9821
Using
I created this shortcode in the file
shortcodes/docker/external_networks_creation.md
:external_networks_creation.md
When the shortcode is called using:
The following ERROR is triggered:
Replacing EOF by quotes (") fixes the issue.
The text was updated successfully, but these errors were encountered: