aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2025-09-09 08:47:56 +0200
committerJohn MacFarlane <[email protected]>2025-09-09 10:26:05 +0200
commitff12c20f20067c55f8f55bb66e710b1d8910ad3a (patch)
treef5233b0e1d7e92d1d657ce70c127af6f7b948cc2 /src/Text
parent36bbdc667a72311257a4a8aedaa26b330cf01206 (diff)
LaTeX writer: Don't add links to TOC.
Fixes: #11124
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index a2175b0d1..eb4671c18 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -785,6 +785,7 @@ sectionHeader classes ident level lst = do
removeInvalidInline x = [x]
let lstNoNotes = foldr (mappend . (\x -> walkM removeInvalidInline x)) mempty lst
txtNoNotes <- inlineListToLaTeX lstNoNotes
+ txtNoLinksNoNotes <- inlineListToLaTeX (removeLinks lstNoNotes)
-- footnotes in sections don't work (except for starred variants)
-- unless you specify an optional argument:
-- \section[mysec]{mysec\footnote{blah}}
@@ -837,7 +838,7 @@ sectionHeader classes ident level lst = do
$$ if unnumbered && not unlisted
then "\\addcontentsline{toc}" <>
braces (text sectionType) <>
- braces txtNoNotes
+ braces txtNoLinksNoNotes
else empty
-- | Convert list of inline elements to LaTeX.