summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-08-22 13:42:56 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2023-08-22 13:42:56 -0700
commit1d951b3e7d00af919961cbb37a2ddec695cd673e (patch)
tree12b502c93f3e4cd59034e73e5eb626068a2d4980 /src
parentd54151c32d525e01c3f403dfbc4dc4d1be2947da (diff)
Fix spacing errors.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/JATS.hs16
1 files changed, 8 insertions, 8 deletions
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