diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-02 12:13:02 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-02 12:13:02 +0100 |
commit | 8709b7cf80498d06863ac987a6b3968b84a7fc85 (patch) | |
tree | 75bb57256c85d48289cc78e5fb9e14311e46367a /src | |
parent | 9e50319df312d6401060f4e0e336d555b5e047fe (diff) | |
download | pandoc-8709b7cf80498d06863ac987a6b3968b84a7fc85.tar.gz |
LaTeX writer: use % after hypertarget before code block
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 5 |
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 $$ |