Switch between HTML and markdown in one .md file


Hey All,

So I know you can use HTML in Hugo as well as Markdown. One stumbling block I have run into is that, from what I can tell, once you introduce HTML, everything else inside the opening and closing tags will be processed as HTML i.e.

<div class="something">
 ## Headline <!-- this will simply be output as ## Headline and not parsed as markdown -->

Is there a way to manually, via a directive maybe, tell Hugo to treat a block as Markdown even though it is wrapped in an HTML tag? Thanks!


You could do this with a shortcode.


{{< foo >}}
## Header
{{</ foo>}}


<div class="something">
{{ .Inner | markdownify }}


Thanks so much @zwbetz, that worked perfectly!