@@ -663,6 +663,7 @@ inline = choice
663663 , pCode
664664 , pSpan
665665 , pMath False
666+ , pScriptMath
666667 , pRawHtmlInline
667668 ]
668669
@@ -822,6 +823,17 @@ toStringAttr :: [(Text, Text)] -> [(String, String)]
822823toStringAttr = map go
823824 where go (x,y) = (T.unpack x, T.unpack y)
824825
826+pScriptMath :: PandocMonad m => TagParser m Inlines
827+pScriptMath = try $ do
828+ TagOpen _ attr' <- pSatisfy $ tagOpen (=="script") (const True)
829+ isdisplay <- case lookup "type" attr' of
830+ Just x | "math/tex" `T.isPrefixOf` x
831+ -> return $ "display" `T.isSuffixOf` x
832+ _ -> mzero
833+ contents <- T.unpack . innerText <$>
834+ manyTill pAnyTag (pSatisfy (matchTagClose "script"))
835+ return $ (if isdisplay then B.displayMath else B.math) contents
836+
825837pMath :: PandocMonad m => Bool -> TagParser m Inlines
826838pMath inCase = try $ do
827839 open@(TagOpen _ attr') <- pSatisfy $ tagOpen (=="math") (const True)