In the manual I found this example of an pandoc lua-filter:
return {
{
Str = function (elem)
if elem.text == "{{helloworld}}" then
return pandoc.Emph {pandoc.Str "Hello, World"}
else
return elem
end
end,
}
}
I want to replace {{helloworld}} with <div>abc</div>. My try:
return {
{
Str = function (elem)
if elem.text == "{{helloworld}}" then
return pandoc.RawInline('html','<div>abc</div>')
else
return elem
end
end,
}
}
...but this give me the following output:
<p></p>
<div>abc</div>
<p></p>
How can I get rid of the empty p-tags?
Additional information
I convert from markdown to html and my markdown file looks like this:

RawInlinewithRawBlock, andStrwithParagraph