You could use Fenced divs: https://pandoc.org/MANUAL.html#divs-and-spans
You can put inside headers, paragraphs, code blocks, etc.
On 05/24/2023 04:51 PM, H wrote:
> Using pandoc 3.1.2 and am trying my hand at writing my first writer to customize HTML output for a specific, predefined newsletter format.
>
> The source document is written in markdown, contains headers of various levels, paragraphs of text, links to images and mail links. No lists, no tables and no code blocks.
>
> The document is structured with an introductory section, multiple identically formatted sections and then a final section at the end. I need to wrap various portions of the structure with <div></div> at multiple levels in order to achieve the desired formatting. Some of the <div></div> tags need to wrap H1, H2, image, multiple paragraphs, other <div></div> tags wrap only one such item. In addition, most HTML tag need to have some predefined custom style information.
>
> This output will be manually added to a certain newsletter editor in a CRM system and I cannot add any CSS information whatsoever, everything has to be structured as outlined above.
>
> Since I am new to writing filters, I am looking for some suggestions how approach the <div></div> wrapping when multiple different HTML items need to be wrapped.
>
> Thank you.
>
I should add that one <div></div> pair may enclose H1, H2, image, and several paragraphs until the next H1 tag or end of document. Another <div></div> pair (within the just-mentioned pair) may enclose the image and several paragraphs, again until the next H1 tag (or end of document). There are some additional levels of <div> pairs but this describes the gist of it.
Suggestions welcome!