diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-14 18:59:50 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-14 18:59:50 -0800 |
commit | 9305114b9ff5a6b742e9e5949e442c188a2f242a (patch) | |
tree | ddfee098ae13c127a20af8902364873074d97dc5 /src/Text | |
parent | 5131589be0de048c9c0b526da715c5430932bf43 (diff) | |
download | pandoc-9305114b9ff5a6b742e9e5949e442c188a2f242a.tar.gz |
LaTeX writer: Escape strings in \href{..}.
Previously strings weren't escaped, so %5D would be interpreted
as a LaTeX comment!
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index fbf443a03..836e0f974 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -370,8 +370,8 @@ inlineToLaTeX (Link txt (src, _)) = do modify $ \s -> s{ stUrl = True } return $ text $ "\\url{" ++ x ++ "}" _ -> do contents <- inlineListToLaTeX $ deVerb txt - return $ text ("\\href{" ++ src ++ "}{") <> contents <> - char '}' + return $ text ("\\href{" ++ stringToLaTeX src ++ "}{") <> + contents <> char '}' inlineToLaTeX (Image _ (source, _)) = do modify $ \s -> s{ stGraphics = True } return $ "\\includegraphics" <> braces (text source) |