If using the {{%-syntax it will work as expected as long as you don’t have surrounding html-elements in your shortcode (black friday will not parse markdown inside of html-elements). But because it is usual to have html in the shortcode you have to work around it, see Shortcode - markdown vs html vs table of content for a possible solution.
Oh, I see. I did not realize that the surrounding HTML content is the problem.
But that is counter intuitive to the documentation. The documentation lists the {{< syntax clearly under “Shortcodes without markdown” - though i realize now it probably means “Shortcodes without markdown surrounding the inner content” (is that correct?).
Right. But: what if I want rendered markdown in the inner content of my shortcode and in the content surrounding the inner content of the shortcode? Plus the inner contnet is wrapped by html.
I’m sorry for the confusion. Even if the documentation may not be clear about this, I’m convinced that current behaviour is the correct compromise. The big problem with the pre 0.55 was that it was not possible to have shortcodes that worked with ToC/footnotes – and this will be even more evident pretty soon.
Yes, it was a ‘breaking’ change that caused some confusion, but the advantages are enormous. I am looking forward seeing what happens next.
Just curious to hear: Why was it not possible to generally allow markdown in the shortcodes html files and use {{% and {{< synonymously? And if you like markdown in the content, just use | markdownify. Would it just have been too much of a break?
There is a history here. Once we had only {{% and it behave like it does today (more or less). But there where all kinds of issues reported with how the different markdown processors handled inline HTML etc. in Markdwon. So, beyond the very simple examples, if you want to preserve HTML as … HTML without any encoding/formatting issues, you want to use the {{<.
It is the total output that is sent as part of the surrounding document to the Markdown processor, not just the “shortcode itself”.
In the above it is obvious that you want to use “{{%”, for the codePen I would guess (I have not looked at it) that “{{<” would be a more sensible choice.
I can speak to this. So the {{% was not really an intentional decision. When I ported that theme, I tried to keep things as same as possible. When the last Hugo shortcode features were released, that particular theme shortcode still “just worked”. So I left it as is. Plus it wouldn’t break things for folks already using the theme.