diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 3203d967e..4e1344cd1 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -590,7 +590,7 @@ hypertargetBlock = try $ do hypertargetInline :: PandocMonad m => LP m Inlines hypertargetInline = try $ do ref <- untokenize <$> braced - ils <- grouped inline + ils <- tok return $ spanWith (ref, [], []) ils newToggle :: (Monoid a, PandocMonad m) => [Tok] -> LP m a diff --git a/test/command/7418.md b/test/command/7418.md new file mode 100644 index 000000000..7f51f19b9 --- /dev/null +++ b/test/command/7418.md @@ -0,0 +1,10 @@ +``` +% pandoc -f markdown+raw_tex -t latex +Lorem \hypertarget{anchor} etc + +Lorem \hyperlink{anchor}{the link} etc +^D +Lorem \hypertarget{anchor} etc + +Lorem \hyperlink{anchor}{the link} etc +```