Closed
Description
pandoc 2.7.2
Consider the following markdown:
~~`hello world`~~
~~_`hello world`_~~
They generate the following LaTeX:
\sout{\texttt{hello\ world}}
\sout{\emph{\texttt{hello\ world}}}
- In Escape inline verbatim spaces in LaTeX output (
\texttt
) #1694, escaped spaces were added to\texttt
.\sout
does not handle this properly. - In LaTeX writer produces erroneous output for striked out code with highlighting #1294, inline highlighted code was wrapped in
\mbox
within strikeout. This is not applied to inline non-highlighted code. That is, removing this line would make it such that the first case would be fixed. - The
protectCode
added in LaTeX writer produces erroneous output for striked out code with highlighting #1294 doesn't seem to walk through the elements. If it did, I think the second case would also be fixed.
My current solution is to run the following panflute
filter:
def protect_code(elem, doc):
if isinstance(elem, pf.Code):
return pf.Span(
pf.RawInline('\\mbox{', 'latex'),
elem,
pf.RawInline('}', 'latex'))
def strikeout(elem, doc):
if not isinstance(elem, pf.Strikeout):
return None
elem.walk(protect_code)
if __name__ == '__main__':
pf.run_filter(strikeout)