texmath 0.11.2 → 0.11.2.1
raw patch · 3 files changed
+11/−17 lines, 3 files
Files
- changelog +6/−0
- src/Text/TeXMath/Readers/OMML.hs +4/−16
- texmath.cabal +1/−1
changelog view
@@ -1,3 +1,9 @@+texmath (0.11.2.1)++ * OMML reader: Don't collapse `fName` to a string (#133).+ This fixes cases where fName has some complexity, e.g.+ a subscript or limit.+ texmath (0.11.2) * Improved handling of \mathop etc (#126). We now allow operators like
src/Text/TeXMath/Readers/OMML.hs view
@@ -303,12 +303,10 @@ fName <- filterChildName (hasElemName "m" "fName") element baseExp <- filterChildName (hasElemName "m" "e") element >>= elemToBase- -- We need a string for the fname, but omml gives it to us as a- -- series of oMath elems. We're going to filter out the oMathRuns,- -- which should work for us most of the time.- let fnameString = concatMap expToString $- concat $ mapMaybe (elemToExps) (elChildren fName)- return [EMathOperator fnameString, baseExp]+ let fnameExp = case mconcat $ mapMaybe (elemToExps') (elChildren fName) of+ [x] -> x+ xs -> EGrouped xs+ return [fnameExp, baseExp] elemToExps' element | isElem "m" "groupChr" element = do let gPr = filterChildName (hasElemName "m" "groupChrPr") element chr = gPr >>=@@ -469,16 +467,6 @@ where isIdentifierOrSpace (EIdentifier _) = True isIdentifierOrSpace (ESpace _) = True isIdentifierOrSpace _ = False--expToString :: Exp -> String-expToString (ENumber s) = s-expToString (EIdentifier s) = s-expToString (EMathOperator s) = s-expToString (ESymbol _ s) = s-expToString (EText _ s) = s-expToString (EGrouped exps) = concatMap expToString exps-expToString (EStyled _ exps) = concatMap expToString exps-expToString _ = "" -- The char attribute is a hex string getSymChar :: Element -> String
texmath.cabal view
@@ -1,5 +1,5 @@ Name: texmath-Version: 0.11.2+Version: 0.11.2.1 Cabal-Version: >= 1.10 Build-type: Simple Synopsis: Conversion between formats used to represent mathematics.