aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx/Parse.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-08 11:26:26 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-08 11:26:26 -0700
commite5fb97ff4faf9473287499ccf60783cc2d7785e9 (patch)
treea4a63a32119ec85d823deb24a653a08790fef488 /src/Text/Pandoc/Readers/Docx/Parse.hs
parent40602c3df69c23c9bc5c42b2de423965cdc2a103 (diff)
parent2f7a627f6dc9f7ee805af4d2a01746c6ab3d45e5 (diff)
downloadpandoc-e5fb97ff4faf9473287499ccf60783cc2d7785e9.tar.gz
Merge pull request #1502 from jkr/streamlineMath
Streamline OMML parser
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx/Parse.hs')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 3b2e7c5ca..8c9b4d672 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -61,7 +61,7 @@ import qualified Text.Pandoc.UTF8 as UTF8
import Control.Monad.Reader
import qualified Data.Map as M
import Text.Pandoc.Compat.Except
-import Text.Pandoc.Readers.Docx.OMath (elemToExps)
+import Text.Pandoc.Readers.Docx.OMath (readOMML)
import Text.TeXMath (Exp)
data ReaderEnv = ReaderEnv { envNotes :: Notes
@@ -475,7 +475,7 @@ elemToBodyPart ns element
| isElem ns "w" "p" element
, (c:_) <- findChildren (elemName ns "m" "oMathPara") element =
do
- expsLst <- mapD (\e -> (maybeToD $ elemToExps ns e)) (elChildren c)
+ expsLst <- mapD (\e -> (maybeToD $ readOMML e)) (elChildren c)
return $ OMathPara expsLst
elemToBodyPart ns element
| isElem ns "w" "p" element
@@ -574,8 +574,8 @@ elemToParPart ns element
Just target -> ExternalHyperLink target runs
Nothing -> ExternalHyperLink "" runs
elemToParPart ns element
- | isElem ns "m" "oMath" element =
- (maybeToD $ elemToExps ns element) >>= (return . PlainOMath)
+ | isElem ns "m" "oMath" element =
+ (maybeToD $ readOMML element) >>= (return . PlainOMath)
elemToParPart _ _ = throwError WrongElem
lookupFootnote :: String -> Notes -> Maybe Element
@@ -677,13 +677,3 @@ elemToRunElems ns element
|| isElem ns "m" "r" element =
mapD (elemToRunElem ns) (elChildren element)
elemToRunElems _ _ = throwError WrongElem
-
-
-
-
-
-
-
-
-
-