mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-20 22:46:06 +00:00
LaTeX writer: Avoid using reserved characters as \lstinline delimiters.
Closes #1595.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user