git.iko.soy/typeable/pandoc
on master help sign in
Removed space at ends of lines in source.
commit4676bfdf825a2b5b205d6057462d317c00c6b354 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 12 Jul 2014, 22:57 (12 years ago) parent8bbcff0
12 files changed+96−96
src/Text/Pandoc.hs+1−1 src/Text/Pandoc/Parsing.hs+37−37 src/Text/Pandoc/Readers/Docx.hs+9−9 src/Text/Pandoc/Readers/Docx/Lists.hs+7−7 src/Text/Pandoc/Readers/Docx/Parse.hs+24−24 src/Text/Pandoc/Readers/Docx/Reducible.hs+4−4 src/Text/Pandoc/Readers/Docx/TexChar.hs+1−1 src/Text/Pandoc/Shared.hs+2−2 src/Text/Pandoc/Writers/AsciiDoc.hs+4−4 src/Text/Pandoc/Writers/ICML.hs+4−4 src/Text/Pandoc/Writers/OpenDocument.hs+2−2 src/Text/Pandoc/Writers/RST.hs+1−1
src/Text/Pandoc.hs+1−1
@@ -303,7 +303,7 @@ getReader :: String -> Either String Reader
303303getReader s =
304304 case parseFormatSpec s of
305305 Left e -> Left $ intercalate "\n" $ [m | Message m <- errorMessages e]
306− Right (readerName, setExts) ->
306+ Right (readerName, setExts) ->
307307 case lookup readerName readers of
308308 Nothing -> Left $ "Unknown reader: " ++ readerName
309309 Just (StringReader r) -> Right $ StringReader $ \o ->
src/Text/Pandoc/Parsing.hs+37−37
@@ -1,4 +1,4 @@
1−{-# LANGUAGE
1+{-# LANGUAGE
22 FlexibleContexts
33, GeneralizedNewtypeDeriving
44, TypeSynonymInstances
@@ -100,7 +100,7 @@ module Text.Pandoc.Parsing ( anyLine,
100100 macro,
101101 applyMacros',
102102 Parser,
103− ParserT,
103+ ParserT,
104104 F(..),
105105 runF,
106106 askF,
@@ -222,7 +222,7 @@ anyLine = do
222222 _ -> mzero
223223
224224-- | Like @manyTill@, but reads at least one item.
225−many1Till :: Stream s m t
225+many1Till :: Stream s m t
226226 => ParserT s st m a
227227 -> ParserT s st m end
228228 -> ParserT s st m [a]
@@ -501,7 +501,7 @@ mathInline =
501501-- displacement (the difference between the source column at the end
502502-- and the source column at the beginning). Vertical displacement
503503-- (source row) is ignored.
504−withHorizDisplacement :: Stream s m Char
504+withHorizDisplacement :: Stream s m Char
505505 => ParserT s st m a -- ^ Parser to apply
506506 -> ParserT s st m (a, Int) -- ^ (result, displacement)
507507withHorizDisplacement parser = do
@@ -528,7 +528,7 @@ withRaw parser = do
528528 return (result, raw)
529529
530530-- | Parses backslash, then applies character parser.
531−escaped :: Stream s m Char
531+escaped :: Stream s m Char
532532 => ParserT s st m Char -- ^ Parser for character to escape
533533 -> ParserT s st m Char
534534escaped parser = try $ char '\\' >> parser
@@ -564,7 +564,7 @@ decimal = do
564564-- returns (DefaultStyle, [next example number]). The next
565565-- example number is incremented in parser state, and the label
566566-- (if present) is added to the label table.
567−exampleNum :: Stream s m Char
567+exampleNum :: Stream s m Char
568568 => ParserT s ParserState m (ListNumberStyle, Int)
569569exampleNum = do
570570 char '@'
@@ -609,7 +609,7 @@ anyOrderedListMarker = choice $
609609 lowerAlpha, lowerRoman, upperAlpha, upperRoman]]
610610
611611-- | Parses a list number (num) followed by a period, returns list attributes.
612−inPeriod :: Stream s m Char
612+inPeriod :: Stream s m Char
613613 => ParserT s st m (ListNumberStyle, Int)
614614 -> ParserT s st m ListAttributes
615615inPeriod num = try $ do
@@ -621,7 +621,7 @@ inPeriod num = try $ do
621621 return (start, style, delim)
622622
623623-- | Parses a list number (num) followed by a paren, returns list attributes.
624−inOneParen :: Stream s m Char
624+inOneParen :: Stream s m Char
625625 => ParserT s st m (ListNumberStyle, Int)
626626 -> ParserT s st m ListAttributes
627627inOneParen num = try $ do
@@ -630,7 +630,7 @@ inOneParen num = try $ do
630630 return (start, style, OneParen)
631631
632632-- | Parses a list number (num) enclosed in parens, returns list attributes.
633−inTwoParens :: Stream s m Char
633+inTwoParens :: Stream s m Char
634634 => ParserT s st m (ListNumberStyle, Int)
635635 -> ParserT s st m ListAttributes
636636inTwoParens num = try $ do
@@ -641,7 +641,7 @@ inTwoParens num = try $ do
641641
642642-- | Parses an ordered list marker with a given style and delimiter,
643643-- returns number.
644−orderedListMarker :: Stream s m Char
644+orderedListMarker :: Stream s m Char
645645 => ListNumberStyle
646646 -> ListNumberDelim
647647 -> ParserT s ParserState m Int
@@ -688,7 +688,7 @@ lineBlockLines = try $ do
688688
689689-- | Parse a table using 'headerParser', 'rowParser',
690690-- 'lineParser', and 'footerParser'.
691−tableWith :: Stream s m Char
691+tableWith :: Stream s m Char
692692 => ParserT s ParserState m ([[Block]], [Alignment], [Int])
693693 -> ([Int] -> ParserT s ParserState m [[Block]])
694694 -> ParserT s ParserState m sep
@@ -735,7 +735,7 @@ widthsFromIndices numColumns' indices =
735735-- (which may be grid), then the rows,
736736-- which may be grid, separated by blank lines, and
737737-- ending with a footer (dashed line followed by blank line).
738−gridTableWith :: Stream [Char] m Char
738+gridTableWith :: Stream [Char] m Char
739739 => ParserT [Char] ParserState m [Block] -- ^ Block list parser
740740 -> Bool -- ^ Headerless table
741741 -> ParserT [Char] ParserState m Block
@@ -765,7 +765,7 @@ gridTableSep :: Stream s m Char => Char -> ParserT s ParserState m Char
765765gridTableSep ch = try $ gridDashedLines ch >> return '\n'
766766
767767-- | Parse header for a grid table.
768−gridTableHeader :: Stream [Char] m Char
768+gridTableHeader :: Stream [Char] m Char
769769 => Bool -- ^ Headerless table
770770 -> ParserT [Char] ParserState m [Block]
771771 -> ParserT [Char] ParserState m ([[Block]], [Alignment], [Int])
@@ -798,7 +798,7 @@ gridTableRawLine indices = do
798798 return (gridTableSplitLine indices line)
799799
800800-- | Parse row of grid table.
801−gridTableRow :: Stream [Char] m Char
801+gridTableRow :: Stream [Char] m Char
802802 => ParserT [Char] ParserState m [Block]
803803 -> [Int]
804804 -> ParserT [Char] ParserState m [[Block]]
@@ -826,7 +826,7 @@ gridTableFooter = blanklines
826826---
827827
828828-- | Parse a string with a given parser and state.
829−readWith :: (Show s, Stream s Identity Char)
829+readWith :: (Show s, Stream s Identity Char)
830830 => ParserT s st Identity a -- ^ parser
831831 -> st -- ^ initial state
832832 -> s -- ^ input
@@ -844,7 +844,7 @@ readWith parser state input =
844844 Right result -> result
845845
846846-- | Parse a string with @parser@ (for testing).
847−testStringWith :: (Show s, Show a, Stream s Identity Char)
847+testStringWith :: (Show s, Show a, Stream s Identity Char)
848848 => ParserT s ParserState Identity a
849849 -> s
850850 -> IO ()
@@ -1038,7 +1038,7 @@ registerHeader (ident,classes,kvs) header' = do
10381038failUnlessSmart :: (Stream s m a, HasReaderOptions st) => ParserT s st m ()
10391039failUnlessSmart = getOption readerSmart >>= guard
10401040
1041−smartPunctuation :: Stream s m Char
1041+smartPunctuation :: Stream s m Char
10421042 => ParserT s ParserState m Inlines
10431043 -> ParserT s ParserState m Inlines
10441044smartPunctuation inlineParser = do
@@ -1048,12 +1048,12 @@ smartPunctuation inlineParser = do
10481048apostrophe :: Stream s m Char => ParserT s st m Inlines
10491049apostrophe = (char '\'' <|> char '\8217') >> return (B.str "\x2019")
10501050
1051−quoted :: Stream s m Char
1051+quoted :: Stream s m Char
10521052 => ParserT s ParserState m Inlines
10531053 -> ParserT s ParserState m Inlines
10541054quoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser
10551055
1056−withQuoteContext :: Stream s m t
1056+withQuoteContext :: Stream s m t
10571057 => QuoteContext
10581058 -> ParserT s ParserState m a
10591059 -> ParserT s ParserState m a
@@ -1066,7 +1066,7 @@ withQuoteContext context parser = do
10661066 setState newState { stateQuoteContext = oldQuoteContext }
10671067 return result
10681068
1069−singleQuoted :: Stream s m Char
1069+singleQuoted :: Stream s m Char
10701070 => ParserT s ParserState m Inlines
10711071 -> ParserT s ParserState m Inlines
10721072singleQuoted inlineParser = try $ do
@@ -1074,7 +1074,7 @@ singleQuoted inlineParser = try $ do
10741074 withQuoteContext InSingleQuote $ many1Till inlineParser singleQuoteEnd >>=
10751075 return . B.singleQuoted . mconcat
10761076
1077−doubleQuoted :: Stream s m Char
1077+doubleQuoted :: Stream s m Char
10781078 => ParserT s ParserState m Inlines
10791079 -> ParserT s ParserState m Inlines
10801080doubleQuoted inlineParser = try $ do
@@ -1082,8 +1082,8 @@ doubleQuoted inlineParser = try $ do
10821082 withQuoteContext InDoubleQuote $ manyTill inlineParser doubleQuoteEnd >>=
10831083 return . B.doubleQuoted . mconcat
10841084
1085−failIfInQuoteContext :: Stream s m t
1086− => QuoteContext
1085+failIfInQuoteContext :: Stream s m t
1086+ => QuoteContext
10871087 -> ParserT s ParserState m ()
10881088failIfInQuoteContext context = do
10891089 st <- getState
@@ -1097,7 +1097,7 @@ charOrRef cs =
10971097 guard (c `elem` cs)
10981098 return c)
10991099
1100−singleQuoteStart :: Stream s m Char
1100+singleQuoteStart :: Stream s m Char
11011101 => ParserT s ParserState m ()
11021102singleQuoteStart = do
11031103 failIfInQuoteContext InSingleQuote
@@ -1105,24 +1105,24 @@ singleQuoteStart = do
11051105 guard =<< notAfterString
11061106 () <$ charOrRef "'\8216\145"
11071107
1108−singleQuoteEnd :: Stream s m Char
1108+singleQuoteEnd :: Stream s m Char
11091109 => ParserT s st m ()
11101110singleQuoteEnd = try $ do
11111111 charOrRef "'\8217\146"
11121112 notFollowedBy alphaNum
11131113
1114−doubleQuoteStart :: Stream s m Char
1114+doubleQuoteStart :: Stream s m Char
11151115 => ParserT s ParserState m ()
11161116doubleQuoteStart = do
11171117 failIfInQuoteContext InDoubleQuote
11181118 try $ do charOrRef "\"\8220\147"
11191119 notFollowedBy . satisfy $ flip elem [' ', '\t', '\n']
11201120
1121−doubleQuoteEnd :: Stream s m Char
1121+doubleQuoteEnd :: Stream s m Char
11221122 => ParserT s st m ()
11231123doubleQuoteEnd = void (charOrRef "\"\8221\148")
11241124
1125−ellipses :: Stream s m Char
1125+ellipses :: Stream s m Char
11261126 => ParserT s st m Inlines
11271127ellipses = do
11281128 try (charOrRef "\8230\133") <|> try (string "..." >> return '…')
@@ -1136,32 +1136,32 @@ dash = do
11361136 else B.str <$> (hyphenDash <|> emDash <|> enDash)
11371137
11381138-- Two hyphens = en-dash, three = em-dash
1139−hyphenDash :: Stream s m Char
1139+hyphenDash :: Stream s m Char
11401140 => ParserT s st m String
11411141hyphenDash = do
11421142 try $ string "--"
11431143 option "\8211" (char '-' >> return "\8212")
11441144
1145−emDash :: Stream s m Char
1145+emDash :: Stream s m Char
11461146 => ParserT s st m String
11471147emDash = do
11481148 try (charOrRef "\8212\151")
11491149 return "\8212"
11501150
1151−enDash :: Stream s m Char
1151+enDash :: Stream s m Char
11521152 => ParserT s st m String
11531153enDash = do
11541154 try (charOrRef "\8212\151")
11551155 return "\8211"
11561156
1157−enDashOld :: Stream s m Char
1157+enDashOld :: Stream s m Char
11581158 => ParserT s st m Inlines
11591159enDashOld = do
11601160 try (charOrRef "\8211\150") <|>
11611161 try (char '-' >> lookAhead (satisfy isDigit) >> return '–')
11621162 return (B.str "\8211")
11631163
1164−emDashOld :: Stream s m Char
1164+emDashOld :: Stream s m Char
11651165 => ParserT s st m Inlines
11661166emDashOld = do
11671167 try (charOrRef "\8212\151") <|> (try $ string "--" >> optional (char '-') >> return '-')
@@ -1169,7 +1169,7 @@ emDashOld = do
11691169
11701170-- This is used to prevent exponential blowups for things like:
11711171-- a**a*a**a*a**a*a**a*a**a*a**a*a**
1172−nested :: Stream s m a
1172+nested :: Stream s m a
11731173 => ParserT s ParserState m a
11741174 -> ParserT s ParserState m a
11751175nested p = do
@@ -1198,7 +1198,7 @@ citeKey = try $ do
11981198--
11991199
12001200-- | Parse a \newcommand or \renewcommand macro definition.
1201−macro :: (Stream [Char] m Char, HasMacros st, HasReaderOptions st)
1201+macro :: (Stream [Char] m Char, HasMacros st, HasReaderOptions st)
12021202 => ParserT [Char] st m Blocks
12031203macro = do
12041204 apply <- getOption readerApplyMacros
@@ -1214,8 +1214,8 @@ macro = do
12141214 else return $ rawBlock "latex" def'
12151215
12161216-- | Apply current macros to string.
1217−applyMacros' :: Stream [Char] m Char
1218− => String
1217+applyMacros' :: Stream [Char] m Char
1218+ => String
12191219 -> ParserT [Char] ParserState m String
12201220applyMacros' target = do
12211221 apply <- getOption readerApplyMacros
src/Text/Pandoc/Readers/Docx.hs+9−9
@@ -150,7 +150,7 @@ runStyleToContainers rPr =
150150 classContainers = case rStyle rPr of
151151 Nothing -> []
152152 Just s -> spanClassToContainers s
153−
153+
154154 formatters = map Container $ mapMaybe id
155155 [ if isBold rPr then (Just Strong) else Nothing
156156 , if isItalic rPr then (Just Emph) else Nothing
@@ -188,7 +188,7 @@ parStyleToContainers pPr | (c:cs) <- pStyle pPr, c `elem` blockQuoteDivs =
188188parStyleToContainers pPr | (_:cs) <- pStyle pPr =
189189 let pPr' = pPr { pStyle = cs}
190190 in
191− parStyleToContainers pPr'
191+ parStyleToContainers pPr'
192192parStyleToContainers pPr | null (pStyle pPr),
193193 Just left <- indentation pPr >>= leftParIndent,
194194 Just hang <- indentation pPr >>= hangingParIndent =
@@ -205,7 +205,7 @@ parStyleToContainers pPr | null (pStyle pPr),
205205 True -> (Container BlockQuote) : (parStyleToContainers pPr')
206206 False -> parStyleToContainers pPr'
207207parStyleToContainers _ = []
208−
208+
209209
210210strToInlines :: String -> [Inline]
211211strToInlines = toList . text
@@ -258,9 +258,9 @@ runToInlines (Run rs runElems)
258258 | otherwise =
259259 return $
260260 rebuild (runStyleToContainers rs) (concatMap runElemToInlines runElems)
261−runToInlines (Footnote bps) =
261+runToInlines (Footnote bps) =
262262 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
263−runToInlines (Endnote bps) =
263+runToInlines (Endnote bps) =
264264 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
265265
266266makeDataUrl :: String -> B.ByteString -> Maybe String
@@ -343,7 +343,7 @@ oMathElemToTexString (Bar style base) = do
343343 Top -> printf "\\overline{%s}" baseString
344344 Bottom -> printf "\\underline{%s}" baseString
345345oMathElemToTexString (Box base) = baseToTexString base
346−oMathElemToTexString (BorderBox base) =
346+oMathElemToTexString (BorderBox base) =
347347 baseToTexString base >>= (\s -> return $ printf "\\boxed{%s}" s)
348348oMathElemToTexString (Delimiter dPr bases) = do
349349 let beg = fromMaybe '(' (delimBegChar dPr)
@@ -474,7 +474,7 @@ oMathElemToTexString (OMathRun _ run) = return $ stringToTex $ runToString run
474474baseToTexString :: Base -> DocxContext String
475475baseToTexString (Base mathElems) =
476476 concatMapM oMathElemToTexString mathElems
477−
477+
478478
479479isAnchorSpan :: Inline -> Bool
480480isAnchorSpan (Span (ident, classes, kvs) ils) =
@@ -535,7 +535,7 @@ bodyPartToBlocks (Paragraph pPr parparts)
535535 let
536536 otherConts = filter (not . isBlockCodeContainer) (parStyleToContainers pPr)
537537 in
538− return $
538+ return $
539539 rebuild
540540 otherConts
541541 [CodeBlock ("", [], []) (concatMap parPartToString parparts)]
@@ -582,7 +582,7 @@ bodyPartToBlocks (Tbl cap _ look (r:rs)) = do
582582 hdrCells <- case hdr of
583583 Just r' -> rowToBlocksList r'
584584 Nothing -> return []
585−
585+
586586 cells <- mapM rowToBlocksList rows
587587
588588 let size = case null hdrCells of
src/Text/Pandoc/Readers/Docx/Lists.hs+7−7
@@ -121,7 +121,7 @@ handleListParagraphs (
121121 in
122122 handleListParagraphs ((Div attr1 (blks1 ++ [newDiv2])) : blks)
123123handleListParagraphs (blk:blks) = blk : (handleListParagraphs blks)
124−
124+
125125separateBlocks' :: Block -> [[Block]] -> [[Block]]
126126separateBlocks' blk ([] : []) = [[blk]]
127127separateBlocks' b@(BulletList _) acc = (init acc) ++ [(last acc) ++ [b]]
@@ -139,7 +139,7 @@ flatToBullets' :: Integer -> [Block] -> [Block]
139139flatToBullets' _ [] = []
140140flatToBullets' num xs@(b : elems)
141141 | getLevelN b == num = b : (flatToBullets' num elems)
142− | otherwise =
142+ | otherwise =
143143 let bNumId = getNumIdN b
144144 bLevel = getLevelN b
145145 (children, remaining) =
@@ -162,7 +162,7 @@ flatToBullets elems = flatToBullets' (-1) elems
162162
163163blocksToBullets :: [Block] -> [Block]
164164blocksToBullets blks =
165− bottomUp removeListDivs $
165+ bottomUp removeListDivs $
166166 flatToBullets $ (handleListParagraphs blks)
167167
168168plainParaInlines :: Block -> [Inline]
@@ -216,12 +216,12 @@ removeListDivs' blk = [blk]
216216
217217removeListDivs :: [Block] -> [Block]
218218removeListDivs = concatMap removeListDivs'
219−
219+
220220
221221
222222blocksToDefinitions :: [Block] -> [Block]
223223blocksToDefinitions = blocksToDefinitions' [] []
224224
225−
226−
227−
225+
226+
227+
src/Text/Pandoc/Readers/Docx/Parse.hs+24−24
@@ -106,7 +106,7 @@ type NameSpaces = [(String, String)]
106106data Docx = Docx Document
107107 deriving Show
108108
109−data Document = Document NameSpaces Body
109+data Document = Document NameSpaces Body
110110 deriving Show
111111
112112data Body = Body [BodyPart]
@@ -276,7 +276,7 @@ defaultRunStyle = RunStyle { isBold = False
276276 , isSubScript = False
277277 , rUnderline = Nothing
278278 , rStyle = Nothing
279− }
279+ }
280280
281281
282282type Target = String
@@ -286,7 +286,7 @@ type BookMarkId = String
286286type RelId = String
287287type ChangeId = String
288288type Author = String
289−type ChangeDate = String
289+type ChangeDate = String
290290
291291attrToNSPair :: Attr -> Maybe (String, String)
292292attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)
@@ -301,18 +301,18 @@ archiveToDocx archive = do
301301 rEnv = ReaderEnv notes numbering rels media
302302 doc <- runD (archiveToDocument archive) rEnv
303303 return $ Docx doc
304−
304+
305305
306306archiveToDocument :: Archive -> D Document
307307archiveToDocument zf = do
308308 entry <- maybeToD $ findEntryByPath "word/document.xml" zf
309309 docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry
310− let namespaces = mapMaybe attrToNSPair (elAttribs docElem)
310+ let namespaces = mapMaybe attrToNSPair (elAttribs docElem)
311311 bodyElem <- maybeToD $ findChild (elemName namespaces "w" "body") docElem
312312 body <- elemToBody namespaces bodyElem
313313 return $ Document namespaces body
314314
315−elemToBody :: NameSpaces -> Element -> D Body
315+elemToBody :: NameSpaces -> Element -> D Body
316316elemToBody ns element | isElem ns "w" "body" element =
317317 mapD (elemToBodyPart ns) (elChildren element) >>=
318318 (\bps -> return $ Body bps)
@@ -349,10 +349,10 @@ relElemToRelationship element | qName (elName element) == "Relationship" =
349349 target <- findAttr (QName "Target" Nothing Nothing) element
350350 return $ Relationship (relId, target)
351351relElemToRelationship _ = Nothing
352−
352+
353353
354354archiveToRelationships :: Archive -> [Relationship]
355−archiveToRelationships archive =
355+archiveToRelationships archive =
356356 let relPaths = filter filePathIsRel (filesInArchive archive)
357357 entries = mapMaybe (\f -> findEntryByPath f archive) relPaths
358358 relElems = mapMaybe (parseXMLDoc . UTF8.toStringLazy . fromEntry) entries
@@ -445,7 +445,7 @@ archiveToNumbering archive =
445445
446446elemToNotes :: NameSpaces -> String -> Element -> Maybe (M.Map String Element)
447447elemToNotes ns notetype element
448− | isElem ns "w" (notetype ++ "s") element =
448+ | isElem ns "w" (notetype ++ "s") element =
449449 let pairs = mapMaybe
450450 (\e -> findAttr (elemName ns "w" "id") e >>=
451451 (\a -> Just (a, e)))
@@ -478,7 +478,7 @@ elemToTblLook :: NameSpaces -> Element -> D TblLook
478478elemToTblLook ns element | isElem ns "w" "tblLook" element =
479479 let firstRow = findAttr (elemName ns "w" "firstRow") element
480480 val = findAttr (elemName ns "w" "val") element
481− firstRowFmt =
481+ firstRowFmt =
482482 case firstRow of
483483 Just "1" -> True
484484 Just _ -> False
@@ -505,15 +505,15 @@ elemToCell ns element | isElem ns "w" "tc" element =
505505elemToCell _ _ = throwError WrongElem
506506
507507elemToParIndentation :: NameSpaces -> Element -> Maybe ParIndentation
508−elemToParIndentation ns element | isElem ns "w" "ind" element =
508+elemToParIndentation ns element | isElem ns "w" "ind" element =
509509 Just $ ParIndentation {
510510 leftParIndent =
511511 findAttr (QName "left" (lookup "w" ns) (Just "w")) element >>=
512512 stringToInteger
513− , rightParIndent =
513+ , rightParIndent =
514514 findAttr (QName "right" (lookup "w" ns) (Just "w")) element >>=
515515 stringToInteger
516− , hangingParIndent =
516+ , hangingParIndent =
517517 findAttr (QName "hanging" (lookup "w" ns) (Just "w")) element >>=
518518 stringToInteger}
519519elemToParIndentation _ _ = Nothing
@@ -558,7 +558,7 @@ elemToBodyPart ns element
558558 case lookupLevel numId lvl num of
559559 Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts
560560 Nothing -> throwError WrongElem
561−elemToBodyPart ns element
561+elemToBodyPart ns element
562562 | isElem ns "w" "p" element = do
563563 let parstyle = elemToParagraphStyle ns element
564564 parparts <- mapD (elemToParPart ns) (elChildren element)
@@ -667,15 +667,15 @@ elemToMathElem ns element | isElem ns "m" "bar" element = do
667667 base <-maybeToD (findChild (QName "e" (lookup "m" ns) (Just "m")) element) >>=
668668 elemToBase ns
669669 return $ Bar barPr base
670−elemToMathElem ns element | isElem ns "m" "box" element =
670+elemToMathElem ns element | isElem ns "m" "box" element =
671671 maybeToD (findChild (elemName ns "m" "e") element) >>=
672672 elemToBase ns >>=
673673 (\b -> return $ Box b)
674−elemToMathElem ns element | isElem ns "m" "borderBox" element =
674+elemToMathElem ns element | isElem ns "m" "borderBox" element =
675675 maybeToD (findChild (elemName ns "m" "e") element) >>=
676676 elemToBase ns >>=
677677 (\b -> return $ BorderBox b)
678−elemToMathElem ns element | isElem ns "m" "d" element =
678+elemToMathElem ns element | isElem ns "m" "d" element =
679679 let style = elemToDelimStyle ns element
680680 in
681681 mapD (elemToBase ns) (elChildren element) >>=
@@ -684,8 +684,8 @@ elemToMathElem ns element | isElem ns "m" "eqArr" element =
684684 mapD (elemToBase ns) (elChildren element) >>=
685685 (\es -> return $ EquationArray es)
686686elemToMathElem ns element | isElem ns "m" "f" element = do
687− num <- maybeToD $ findChild (elemName ns "m" "num") element
688− den <- maybeToD $ findChild (elemName ns "m" "den") element
687+ num <- maybeToD $ findChild (elemName ns "m" "num") element
688+ den <- maybeToD $ findChild (elemName ns "m" "den") element
689689 numElems <- mapD (elemToMathElem ns) (elChildren num)
690690 denElems <- mapD (elemToMathElem ns) (elChildren den)
691691 return $ Fraction numElems denElems
@@ -695,7 +695,7 @@ elemToMathElem ns element | isElem ns "m" "func" element = do
695695 elemToBase ns
696696 fnElems <- mapD (elemToMathElem ns) (elChildren fName)
697697 return $ Function fnElems base
698−elemToMathElem ns element | isElem ns "m" "groupChr" element =
698+elemToMathElem ns element | isElem ns "m" "groupChr" element =
699699 let style = elemToGroupStyle ns element
700700 in
701701 maybeToD (findChild (elemName ns "m" "e") element) >>=
@@ -920,11 +920,11 @@ elemToRunElems ns element
920920elemToRunElems _ _ = throwError WrongElem
921921
922922
923−
924−
925923
926924
927925
928926
929−
930−
927+
928+
929+
930+
src/Text/Pandoc/Readers/Docx/Reducible.hs+4−4
@@ -90,7 +90,7 @@ combineReducibles r s =
9090 True -> case (not . null) rs && isSpace (last rs) of
9191 True -> rebuild conts (init rs) ++ [last rs, s]
9292 False -> [r,s]
93− False -> rebuild
93+ False -> rebuild
9494 shared $
9595 reduceList $
9696 (rebuild remaining rs) ++ (rebuild remaining' ss)
@@ -145,7 +145,7 @@ instance Reducible Inline where
145145 isSpace _ = False
146146
147147instance Reducible Block where
148− (Div (ident, classes, kvs) blks) <++> blk | "list-item" `elem` classes =
148+ (Div (ident, classes, kvs) blks) <++> blk | "list-item" `elem` classes =
149149 [Div (ident, classes, kvs) (reduceList blks), blk]
150150
151151 blk <++> blk' = combineReducibles blk blk'
@@ -177,5 +177,5 @@ rebuild :: [Container a] -> [a] -> [a]
177177rebuild [] xs = xs
178178rebuild ((Container f) : cs) xs = rebuild cs $ [f xs]
179179rebuild (NullContainer : cs) xs = rebuild cs $ xs
180−
181−
180+
181+
src/Text/Pandoc/Readers/Docx/TexChar.hs+1−1
@@ -4382,5 +4382,5 @@ uniconvMap = M.fromList [ ('\8193', "\\quad")
43824382-- , ('\120829', "\\mttseven")
43834383-- , ('\120830', "\\mtteight")
43844384-- , ('\120831', "\\mttnine")
4385−
4385+
43864386-- ]
src/Text/Pandoc/Shared.hs+2−2
@@ -335,10 +335,10 @@ isSpaceOrEmpty (Str "") = True
335335isSpaceOrEmpty _ = False
336336
337337-- | Extract the leading and trailing spaces from inside an inline element
338−-- and place them outside the element.
338+-- and place them outside the element.
339339
340340extractSpaces :: (Inlines -> Inlines) -> Inlines -> Inlines
341−extractSpaces f is =
341+extractSpaces f is =
342342 let contents = B.unMany is
343343 left = case viewl contents of
344344 (Space :< _) -> B.space
src/Text/Pandoc/Writers/AsciiDoc.hs+4−4
@@ -142,10 +142,10 @@ blockToAsciiDoc opts (Header level (ident,_,_) inlines) = do
142142 let len = offset contents
143143 -- ident seem to be empty most of the time and asciidoc will generate them automatically
144144 -- so lets make them not show up when null
145− let identifier = if (null ident) then empty else ("[[" <> text ident <> "]]")
145+ let identifier = if (null ident) then empty else ("[[" <> text ident <> "]]")
146146 let setext = writerSetextHeaders opts
147− return $
148− (if setext
147+ return $
148+ (if setext
149149 then
150150 identifier $$ contents $$
151151 (case level of
@@ -155,7 +155,7 @@ blockToAsciiDoc opts (Header level (ident,_,_) inlines) = do
155155 4 -> text $ replicate len '+'
156156 _ -> empty) <> blankline
157157 else
158− identifier $$ text (replicate level '=') <> space <> contents <> blankline)
158+ identifier $$ text (replicate level '=') <> space <> contents <> blankline)
159159blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $
160160 flush (attrs <> dashes <> space <> attrs <> cr <> text str <>
161161 cr <> dashes) <> blankline
src/Text/Pandoc/Writers/ICML.hs+4−4
@@ -42,7 +42,7 @@ type WS a = State WriterState a
4242
4343defaultWriterState :: WriterState
4444defaultWriterState = WriterState{
45− blockStyles = Set.empty
45+ blockStyles = Set.empty
4646 , inlineStyles = Set.empty
4747 , links = []
4848 , listDepth = 1
@@ -267,7 +267,7 @@ hyperlinksToDoc (x:xs) = hyp x $$ hyperlinksToDoc xs
267267 $ inTags False "BorderColor" [("type","enumeration")] (text "Black")
268268 $$ (inTags False "Destination" [("type","object")]
269269 $ text $ "HyperlinkURLDestination/"++(escapeStringForXML url))
270−
270+
271271
272272-- | Convert a list of Pandoc blocks to ICML.
273273blocksToICML :: WriterOptions -> Style -> [Block] -> WS Doc
@@ -352,7 +352,7 @@ listItemsToICML opts listType style attribs (first:rest) = do
352352-- | Convert a list of blocks to ICML list items.
353353listItemToICML :: WriterOptions -> Style -> Bool-> Maybe ListAttributes -> [Block] -> WS Doc
354354listItemToICML opts style isFirst attribs item =
355− let makeNumbStart (Just (beginsWith, numbStl, _)) =
355+ let makeNumbStart (Just (beginsWith, numbStl, _)) =
356356 let doN DefaultStyle = []
357357 doN LowerRoman = [lowerRomanName]
358358 doN UpperRoman = [upperRomanName]
@@ -467,7 +467,7 @@ parStyle opts style lst =
467467
468468-- | Wrap a Doc in an ICML Character Style.
469469charStyle :: Style -> Doc -> WS Doc
470−charStyle style content =
470+charStyle style content =
471471 let (stlStr, attrs) = styleToStrAttr style
472472 doc = inTags True "CharacterStyleRange" attrs $ inTagsSimple "Content" $ flush content
473473 in do
src/Text/Pandoc/Writers/OpenDocument.hs+2−2
@@ -504,7 +504,7 @@ paraStyle parent attrs = do
504504 tight = if t then [ ("fo:margin-top" , "0in" )
505505 , ("fo:margin-bottom" , "0in" )]
506506 else []
507− indent = if (i /= 0 || b)
507+ indent = if (i /= 0 || b)
508508 then [ ("fo:margin-left" , indentVal)
509509 , ("fo:margin-right" , "0in" )
510510 , ("fo:text-indent" , "0in" )
@@ -534,7 +534,7 @@ paraTableStyles t s (a:xs)
534534 [ ("fo:text-align", x)
535535 , ("style:justify-single-word", "false")]
536536
537−data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
537+data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
538538 deriving ( Eq,Ord )
539539
540540textStyleAttr :: TextStyle -> [(String,String)]
src/Text/Pandoc/Writers/RST.hs+1−1
@@ -174,7 +174,7 @@ blockToRST (Para [Image txt (src,'f':'i':'g':':':tit)]) = do
174174 let alt = ":alt: " <> if null tit then capt else text tit
175175 return $ hang 3 ".. " $ fig $$ alt $+$ capt $$ blankline
176176blockToRST (Para inlines)
177− | LineBreak `elem` inlines = do -- use line block if LineBreaks
177+ | LineBreak `elem` inlines = do -- use line block if LineBreaks
178178 lns <- mapM inlineListToRST $ splitBy (==LineBreak) inlines
179179 return $ (vcat $ map (text "| " <>) lns) <> blankline
180180 | otherwise = do