File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -927,25 +927,21 @@ pMath inCase = try $ do
927927 let attr = toStringAttr attr'
928928 unless inCase $
929929 guard (maybe True (== mathMLNamespace) (lookup " xmlns" attr))
930- let isDisplay = case lookup " display" attr of
931- Just " block" -> True
932- _ -> False
930+ let constructor = case lookup " display" attr of
931+ Just " block" -> B. displayMath
932+ _ -> B. math
933933 contents <- manyTill pAny (pSatisfy (matchTagClose " math" ))
934934 -- KaTeX and others include original TeX in annotation tag;
935935 -- just use this if present rather than parsing MathML:
936936 case extractTeXAnnotation contents of
937- Just x -> return $ if isDisplay
938- then B. displayMath x
939- else B. math x
937+ Just x -> return $ constructor x
940938 Nothing ->
941939 case mathMLToTeXMath (renderTags $
942940 [open] <> contents <> [TagClose " math" ]) of
943941 Left _ -> return $ B. spanWith (" " ,[" math" ],attr) $ B. text $
944942 innerText contents
945943 Right " " -> return mempty
946- Right x -> return $ if isDisplay
947- then B. displayMath x
948- else B. math x
944+ Right x -> return $ constructor x
949945
950946extractTeXAnnotation :: [Tag Text ] -> Maybe Text
951947extractTeXAnnotation [] = Nothing
You can’t perform that action at this time.
0 commit comments