Skip to content
Discussion options

You must be logged in to vote

After some trials, I've figured out I've asked this kind of question, rendering both HTML and Markdown content in shortcode before (and you've answered it!)

The solution was to remove some line breaks in original source code.
images/image shortcode calls images/picture in my case. It has this code

<picture
{{ with .wrapperClass }}class="{{ . }}"{{ end }}
{{ range .attrs }}{{ . | safeHTMLAttr }}{{ end }}>

If there is no .wrapperClass and .attrs, it will produce this HTML code.

<picture
>

While this is valid HTML, Hugo doesn't seem to think it as valid HTML code. That's why I've got <p>&lt;picture</p> when the content of collapse is rendered.

So I copied images/picture to local and modified…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
5 replies
@TetraTheta
Comment options

@razonyang
Comment options

@razonyang
Comment options

@TetraTheta
Comment options

@razonyang
Comment options

Comment options

You must be logged in to vote
5 replies
@TetraTheta
Comment options

@razonyang
Comment options

@TetraTheta
Comment options

Answer selected by TetraTheta
@razonyang
Comment options

@TetraTheta
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants