The pandocfilters package on CRAN looks very promising for adjusting the pandoc output for (R)Markdown files.
However, the vignette only gives an example how this would work from within R, i.e. without using the filter as an option passed to pandoc.
How would a simple filter for this kind of workflow look like?