git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer: use `trim` from Shared
0287530Jesse Rosenthal
src/Text/Pandoc/Writers/Powerpoint/Presentation.hs+2−3
@@ -76,7 +76,6 @@ import Data.Maybe (maybeToList, fromMaybe)
76import Text.Pandoc.Highlighting
76import Text.Pandoc.Highlighting
77import qualified Data.Text as T
77import qualified Data.Text as T
78import Control.Applicative ((<|>))
78import Control.Applicative ((<|>))
79−import Data.Char (isSpace)
80import Skylighting
79import Skylighting
81
80
82data WriterEnv = WriterEnv { envMetadata :: Meta
81data WriterEnv = WriterEnv { envMetadata :: Meta
@@ -855,9 +854,9 @@ replaceAnchor pe = return pe
855
854
856emptyParaElem :: ParaElem -> Bool
855emptyParaElem :: ParaElem -> Bool
857emptyParaElem (Run _ s) =
856emptyParaElem (Run _ s) =
858− null $ dropWhile isSpace $ reverse $ dropWhile isSpace $ reverse s
857+ null $ Shared.trim s
859emptyParaElem (MathElem _ ts) =
858emptyParaElem (MathElem _ ts) =
860− null $ dropWhile isSpace $ reverse $ dropWhile isSpace $ reverse $ unTeXString ts
859+ null $ Shared.trim $ unTeXString ts
861emptyParaElem _ = False
860emptyParaElem _ = False
862
861
863emptyParagraph :: Paragraph -> Bool
862emptyParagraph :: Paragraph -> Bool
test/Tests/Writers/OOXML.hs−2
@@ -33,12 +33,10 @@ compareXMLBool (Elem myElem) (Elem goodElem) =
33 elName myElem == elName goodElem &&
33 elName myElem == elName goodElem &&
34 elAttribs myElem == elAttribs goodElem &&
34 elAttribs myElem == elAttribs goodElem &&
35 and (zipWith compareXMLBool (elContent myElem) (elContent goodElem))
35 and (zipWith compareXMLBool (elContent myElem) (elContent goodElem))
36−
37compareXMLBool (Text myCData) (Text goodCData) =
36compareXMLBool (Text myCData) (Text goodCData) =
38 cdVerbatim myCData == cdVerbatim goodCData &&
37 cdVerbatim myCData == cdVerbatim goodCData &&
39 cdData myCData == cdData goodCData &&
38 cdData myCData == cdData goodCData &&
40 cdLine myCData == cdLine goodCData
39 cdLine myCData == cdLine goodCData
41−
42compareXMLBool (CRef myStr) (CRef goodStr) =
40compareXMLBool (CRef myStr) (CRef goodStr) =
43 myStr == goodStr
41 myStr == goodStr
44compareXMLBool _ _ = False
42compareXMLBool _ _ = False