In my document I have a placeholder string like:
{{changelog}}
And would like to replace this with a Markdown formatted table using a Lua filter, the following Lua filter works if I use HTML:
local string = [[
| some | table |
|------|-------|
| val1 | val2 |
]]
string = [[
<table>
<tr>
<td>some</td>
<td>table</td>
</tr>
<tr>
<td>val1</td>
<td>val2</td>
</tr>
</table>
]]
function Para(elem)
if elem.content[1].text == "{{changelog}}" then
return pandoc.RawBlock('html', string)
else
return elem
end
end
return {{ Para = Para }}
Now this works using the HTML content of variable string but how do I get it to work with Markdown formatted content in variable string.