diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-09-01 10:11:09 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-09-01 10:11:09 -0700 |
commit | cb1a8da01c5ff98d8e2bc64efb1c401c1cf0dc82 (patch) | |
tree | 2a440b2aa5c6e04956299435c8070cca691ce57d /src/Text/Pandoc | |
parent | 43ebb0229ffb96895b54e49447eabbea66c4f0f8 (diff) | |
download | pandoc-cb1a8da01c5ff98d8e2bc64efb1c401c1cf0dc82.tar.gz |
LaTeX writer: Avoid using reserved characters as \lstinline delimiters.
Closes #1595.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 8e3befe19..3596b75e9 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -731,7 +731,9 @@ inlineToLaTeX (Code (_,classes,_) str) = do where listingsCode = do inNote <- gets stInNote when inNote $ modify $ \s -> s{ stVerbInNote = True } - let chr = ((enumFromTo '!' '~') \\ str) !! 0 + let chr = case "!\"&'()*,-./:;?@_" \\ str of + (c:_) -> c + [] -> '!' return $ text $ "\\lstinline" ++ [chr] ++ str ++ [chr] highlightCode = do case highlight formatLaTeXInline ("",classes,[]) str of |