LaTeX writer: Avoid using reserved characters as \lstinline delimiters.

Closes #1595.
This commit is contained in:
John MacFarlane
2014-09-01 10:11:09 -07:00
parent 43ebb0229f
commit cb1a8da01c
+3 -1
View File
@@ -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