From c09d7b070022e19429f4a2b0d832a50421fee627 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Thu, 28 Sep 2023 01:02:07 +0000 Subject: [PATCH] Check if supplied FORMAT matches with an HTML slide deck value. Return True for isRawHtml. --- src/Text/Pandoc/Writers/HTML.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index efe750ecc723..8c518e271d12 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1731,11 +1731,20 @@ intrinsicEventsHTML4 = [ "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover" , "onmouseout", "onmouseout", "onkeypress", "onkeydown", "onkeyup"] + +-- | Check to see if Format is valid HTML isRawHtml :: PandocMonad m => Format -> StateT WriterState m Bool isRawHtml f = do html5 <- gets stHtml5 return $ f == Format "html" || - ((html5 && f == Format "html5") || f == Format "html4") + ((html5 && f == Format "html5") || f == Format "html4") || + isSlideVariant f + +-- | Check to see if Format matches with an HTML slide variant +isSlideVariant :: Format -> Bool +isSlideVariant f = f `elem` [Format "s5", Format "slidy", Format "slideous", + Format "dzslides", Format "revealjs"] + -- We need to remove links from link text, because an element is -- not allowed inside another element.