From 9e50319df312d6401060f4e0e336d555b5e047fe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Mar 2017 11:53:17 +0100 Subject: [PATCH] LaTeX writer: minor tweak to hypertarget (semantically irrelevant). --- src/Text/Pandoc/Writers/LaTeX.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 054a16259..789593118 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -841,7 +841,9 @@ hypertarget addnewline ident x = do ref <- text `fmap` toLabel ident return $ text "\\hypertarget" <> braces ref - <> braces ((if addnewline then ("%" <> cr) else empty) <> x) + <> braces ((if addnewline && not (isEmpty x) + then ("%" <> cr) + else empty) <> x) labelFor :: PandocMonad m => String -> LW m Doc labelFor "" = return empty