From 1d951b3e7d00af919961cbb37a2ddec695cd673e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 22 Aug 2023 13:42:56 -0700 Subject: Fix spacing errors. --- src/Text/Pandoc/Readers/JATS.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs index 5056eb3ff..7b32f1e28 100644 --- a/src/Text/Pandoc/Readers/JATS.hs +++ b/src/Text/Pandoc/Readers/JATS.hs @@ -107,8 +107,8 @@ instance HasMeta JATSState where isBlockElement :: Content -> Bool isBlockElement (Elem e) = case qName (elName e) of "disp-formula" -> if onlyOneChild e - then if hasFormulaChild e - then False + then if hasFormulaChild e + then False else case filterChild (named "alternatives") e of Just a -> if hasFormulaChild a then False else True Nothing -> True @@ -125,10 +125,10 @@ isBlockElement (Elem e) = case qName (elName e) of formulae = ["tex-math", "mml:math"] other = ["p", "related-article", "related-object", "ack", "disp-quote", "speech", "statement", "verse-group", "x"] - canBeInline = ["tex-math", "mml:math", "related-object", "x"] + canBeInline = ["tex-math", "mml:math", "related-object", "x"] onlyOneChild x = length (allChildren x) == 1 allChildren x = filterChildren (const True) x - + isBlockElement _ = False -- Trim leading and trailing newline characters @@ -221,7 +221,7 @@ parseBlock (Elem e) = do else getBlocks e "disp-formula" -> if hasFormulaChild e then blockFormula displayMath e - else divWith (attrValue "id" e, ["disp-formula"], []) + else divWith (attrValue "id" e, ["disp-formula"], []) <$> getBlocks e "?xml" -> return mempty _ -> getBlocks e @@ -647,8 +647,8 @@ blockFormula constructor e = do filterChildren isMathML whereToLook return . para . head . take 1 . map constructor $ texMaths ++ mathMLs -mathML :: Element -> Text -mathML x = +mathML :: Element -> Text +mathML x = case readMathML . showElement $ everywhere (mkT removePrefix) x of Left _ -> mempty Right m -> writeTeX m @@ -663,4 +663,4 @@ formulaChildren :: Element -> [Element] formulaChildren x = filterChildren isMathML x ++ filterChildren (named "tex-math") x hasFormulaChild :: Element -> Bool -hasFormulaChild x = length (formulaChildren x) > 0 \ No newline at end of file +hasFormulaChild x = length (formulaChildren x) > 0 -- cgit v1.2.3