I have a markdown file that contains some HTML tags in it and one in particular, the <br> tag I would like to replace when converting to HTML using pandoc. The issue is I would like to replace it with <br /> due to some compatibility issues with some older renderers that complain about <br>. I did try the following Lua filter when running the conversion but it did not do anything:
filter.lua:
function LineBreak (elem)
return {
pandoc.RawInline('html', '<br />')
}
end
I'm using Pandoc version 2.13 running the following command with the following test file:
Test.md:
## Testing
Hello <br> World!
pandoc --lua-filter filter.lua --to html5 Test.md
I have also tried specifying --to html4 but the output is still the same. Is there a way to do this with Lua filters?