@@ -490,7 +490,10 @@ blockToLaTeX (BlockQuote lst) = do
490490blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
491491 opts <- gets stOptions
492492 lab <- labelFor identifier
493− linkAnchor <- hypertarget True identifier lab
493+ linkAnchor' <- hypertarget True identifier lab
494+ let linkAnchor = if isEmpty linkAnchor'
495+ then empty
496+ else linkAnchor' <> "%"
494497 let lhsCodeBlock = do
495498 modify $ \s -> s{ stLHS = True }
496499 return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$