aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-02 11:53:17 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-02 11:53:31 +0100
commit9e50319df312d6401060f4e0e336d555b5e047fe (patch)
tree7ba552d6d0b66241e7f6d32f22d7ef7628997107 /src
parenta69cfa017898648a50243812459ec72b45a6fb6b (diff)
downloadpandoc-9e50319df312d6401060f4e0e336d555b5e047fe.tar.gz
LaTeX writer: minor tweak to hypertarget (semantically irrelevant).
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 3 insertions, 1 deletions
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