From 2d20b3aad0a80de3b394bbce7b261f9e11c8b6fc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 4 Jul 2023 11:04:14 -0700 Subject: Typst writer: support `unlisted` class in headings. Closes #8941. --- src/Text/Pandoc/Writers/Typst.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs index 587a5e777..a844865aa 100644 --- a/src/Text/Pandoc/Writers/Typst.hs +++ b/src/Text/Pandoc/Writers/Typst.hs @@ -91,10 +91,15 @@ blockToTypst block = case block of Plain inlines -> inlinesToTypst inlines Para inlines -> ($$ blankline) <$> inlinesToTypst inlines - Header level (ident,_,_) inlines -> do + Header level (ident,cls,_) inlines -> do contents <- inlinesToTypst inlines let lab = toLabel ident - return $ literal (T.replicate level "=") <> space <> contents <> cr <> lab + return $ + if "unlisted" `elem` cls + then literal "#heading(outlined: false)" <> brackets contents <> + cr <> lab + else literal (T.replicate level "=") <> space <> contents <> + cr <> lab RawBlock fmt str -> case fmt of Format "typst" -> return $ literal str -- cgit v1.2.3