How to wrap raw HTML blocks in markdown

726 Views Asked by At

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?

0

There are 0 best solutions below