git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: improve escaping of `@`.

We need to escape literal `@` before `{` because of the new citation syntax.

commit39a69c4f93d46e059c48a740b69dfff219a5d715 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 16 May 2021, 11:53 (5 years ago) parent98a5a63
1 file changed+1−1
src/Text/Pandoc/Writers/Markdown/Inline.hs+1−1
src/Text/Pandoc/Writers/Markdown/Inline.hs+1−1
@@ -56,7 +56,7 @@ escapeText opts = T.pack . go . T.unpack
5656 '@' | isEnabled Ext_citations opts ->
5757 case cs of
5858 (d:_)
59− | isAlphaNum d || d == '_'
59+ | isAlphaNum d || d == '_' || d == '{'
6060 -> '\\':'@':go cs
6161 _ -> '@':go cs
6262 _ | c `elem` ['\\','`','*','_','[',']','#'] ->