aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-02 12:13:02 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-02 12:13:02 +0100
commit8709b7cf80498d06863ac987a6b3968b84a7fc85 (patch)
tree75bb57256c85d48289cc78e5fb9e14311e46367a /src/Text/Pandoc/Writers
parent9e50319df312d6401060f4e0e336d555b5e047fe (diff)
downloadpandoc-8709b7cf80498d06863ac987a6b3968b84a7fc85.tar.gz
LaTeX writer: use % after hypertarget before code block
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 789593118..e54829f94 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -490,7 +490,10 @@ blockToLaTeX (BlockQuote lst) = do
blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
opts <- gets stOptions
lab <- labelFor identifier
- linkAnchor <- hypertarget True identifier lab
+ linkAnchor' <- hypertarget True identifier lab
+ let linkAnchor = if isEmpty linkAnchor'
+ then empty
+ else linkAnchor' <> "%"
let lhsCodeBlock = do
modify $ \s -> s{ stLHS = True }
return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$