From 9305114b9ff5a6b742e9e5949e442c188a2f242a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 14 Jan 2011 18:59:50 -0800 Subject: LaTeX writer: Escape strings in \href{..}. Previously strings weren't escaped, so %5D would be interpreted as a LaTeX comment! --- src/Text/Pandoc/Writers/LaTeX.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers/LaTeX.hs') 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) -- cgit v1.2.3