Skip to content

Commit

Permalink
Fix spacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Oct 27, 2023
1 parent 4f9029c commit 16fa893
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Readers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/Text/Pandoc/Readers/JATS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Writers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]


Expand Down

0 comments on commit 16fa893

Please sign in to comment.