From 16fa893ca78771403b0f9089c1a380cd7790d795 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Oct 2023 12:56:38 -0700 Subject: [PATCH] Fix spacing. --- src/Text/Pandoc/Readers/HTML.hs | 4 ++-- src/Text/Pandoc/Readers/JATS.hs | 22 +++++++++++----------- src/Text/Pandoc/Writers/HTML.hs | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 18441633d945..383892c9b853 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -687,8 +687,8 @@ inline = pTagText <|> do "var" -> pCodeWithClass "var" "variable" "span" -> pSpan "math" -> pMath False - "input" - | lookup "type" attr == Just "checkbox" + "input" + | lookup "type" attr == Just "checkbox" -> asks inListItem >>= guard >> pCheckbox "script" | Just x <- lookup "type" attr diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs index 781c109533c6..0da3bb1ef818 100644 --- a/src/Text/Pandoc/Readers/JATS.hs +++ b/src/Text/Pandoc/Readers/JATS.hs @@ -163,7 +163,7 @@ parseBlock (CRef x) = return $ plain $ str $ T.toUpper x parseBlock (Elem e) = do sectionLevel <- gets jatsSectionLevel let parseBlockWithHeader = wrapWithHeader (sectionLevel+1) (getBlocks e) - + case qName (elName e) of "book" -> parseBook "book-part-wrapper" -> parseBook @@ -234,7 +234,7 @@ parseBlock (Elem e) = do "toc-div" -> parseBlockWithHeader "toc-entry" -> parseBlockWithHeader "toc-group" -> parseBlockWithHeader - "toc-title-group" -> return mempty -- handled by toc + "toc-title-group" -> return mempty -- handled by toc "legend" -> parseBlockWithHeader "dedication" -> parseBlockWithHeader "foreword" -> parseBlockWithHeader @@ -385,17 +385,17 @@ parseBlock (Elem e) = do wrapWithHeader n mBlocks = do isBook <- gets jatsBook let n' = case (filterChild (named "title") e >>= maybeAttrValue "display-as") of - Just t -> read $ T.unpack t - Nothing -> if isBook || n == 0 then n + 1 else n + Just t -> read $ T.unpack t + Nothing -> if isBook || n == 0 then n + 1 else n headerText <- case filterChild (named "title") e of Just t -> case maybeAttrValue "supress" t of - Just s -> if s == "no" - then getInlines t + Just s -> if s == "no" + then getInlines t else return mempty Nothing -> getInlines t Nothing -> do let name = qName (elName e) - if (name == "dedication" || name == "foreword" || name == "preface") + if (name == "dedication" || name == "foreword" || name == "preface") then return $ str $ T.toTitle name else case filterChild (named "index-title-group") e >>= filterChild (named "title") of Just i -> getInlines i @@ -407,10 +407,10 @@ parseBlock (Elem e) = do blocks <- mBlocks let ident = attrValue "id" e modify $ \st -> st{ jatsSectionLevel = oldN } - return $ (if headerText == mempty - then mempty + return $ (if headerText == mempty + then mempty else headerWith (ident,[],[]) n' headerText) <> blocks - parseBook = do + parseBook = do modify $ \st -> st{ jatsBook = True } getBlocks e @@ -421,7 +421,7 @@ getInlines e' = trimInlines . mconcat <$> parseMetadata :: PandocMonad m => Element -> JATS m Blocks parseMetadata e = do isBook <- gets jatsBook - if isBook then getBookTitle e else getArticleTitle e + if isBook then getBookTitle e else getArticleTitle e if isBook then getBookAuthors e else getArticleAuthors e getAffiliations e getAbstract e diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 8c518e271d12..4c5a1d382599 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1732,7 +1732,7 @@ intrinsicEventsHTML4 = , "onmouseout", "onmouseout", "onkeypress", "onkeydown", "onkeyup"] --- | Check to see if Format is valid HTML +-- | Check to see if Format is valid HTML isRawHtml :: PandocMonad m => Format -> StateT WriterState m Bool isRawHtml f = do html5 <- gets stHtml5 @@ -1742,7 +1742,7 @@ isRawHtml f = do -- | Check to see if Format matches with an HTML slide variant isSlideVariant :: Format -> Bool -isSlideVariant f = f `elem` [Format "s5", Format "slidy", Format "slideous", +isSlideVariant f = f `elem` [Format "s5", Format "slidy", Format "slideous", Format "dzslides", Format "revealjs"]