I'm using Pandoc for a large HTML to Markdown conversion project and am trying to write lua filters to handle some of the special cases.
The most common case I am trying to handle is converting specially formatted information boxes into the pymarkdown summary/detail formatting.
Source HTML
<div class="special-info-block">
<p class="title">INFO</p>
</div>
Goal Markdown
???+ info "INFO"
I can use this function to replace the "INFO":
function Div(el)
if el.classes[2] == "special-info-block" and pandoc.utils.stringify(el.content[1]) == "INFO" then
el.content[1] = pandoc.Para('??? info "INFO"+')
return el
end
end
but the resulting markdown escapes the quotation marks around INFO:
???+ info \"INFO\"
How do I insert the literal string instead? Is this a feature of the pandoc.Para constructor or should I be looking elsewhere?
-t markdown-smart
worked perfectly! I had actually tried usingRawBlock
initially but when I do, I end up with this in my output: ```{=markdown}<br/> ??? info "INFO"+<br/> ```<br/> – Hocus