Typst writer: support unlisted class in headings.

Closes #8941.
This commit is contained in:
John MacFarlane
2023-07-04 11:04:14 -07:00
parent ae57c6e3fb
commit 2d20b3aad0
+7 -2
View File
@@ -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