1

Here is the example markdown code that I'm getting from pandoc:

### Header

Paragraph

- Item
- Item

<table>
//COMPLEX TABLE WITH NESTED CELLS GOES HERE AS RAW HTML//
</table>

Paragraph

The markdown file will be used with Hugo, so I need to wrap all raw HTML blocks with {{< rawhtml >}}. So, the output I'm looking for is:

### Header

Paragraph

- Item
- Item

{{< rawhtml >}}
<table>
//COMPLEX TABLE WITH NESTED CELLS GOES HERE AS RAW HTML//
</table>
{{< /rawhtml >}}

Paragraph

I can do it using regex. But is there an easier / more elegant way? Maybe pandoc filters?

Ildar Akhmetov
  • 1,331
  • 13
  • 22
  • 1
    You can allow HTML in the Goldmark markdown parser, see: https://stackoverflow.com/questions/65434800/hugo-dynamic-decide-unsafe-raw-html-omitted. That way this wrapping won't be required. – Mr. Hugo Aug 25 '21 at 19:35

0 Answers0