git.iko.soy/typeable/pandoc
on master help sign in
Removed space at ends of lines in source.
4676bfdJohn MacFarlane
src/Text/Pandoc.hs+1−1
@@ -303,7 +303,7 @@ getReader :: String -> Either String Reader
303getReader s =
303getReader s =
304 case parseFormatSpec s of
304 case parseFormatSpec s of
305 Left e -> Left $ intercalate "\n" $ [m | Message m <- errorMessages e]
305 Left e -> Left $ intercalate "\n" $ [m | Message m <- errorMessages e]
306− Right (readerName, setExts) ->
306+ Right (readerName, setExts) ->
307 case lookup readerName readers of
307 case lookup readerName readers of
308 Nothing -> Left $ "Unknown reader: " ++ readerName
308 Nothing -> Left $ "Unknown reader: " ++ readerName
309 Just (StringReader r) -> Right $ StringReader $ \o ->
309 Just (StringReader r) -> Right $ StringReader $ \o ->
src/Text/Pandoc/Parsing.hs+37−37
@@ -1,4 +1,4 @@
1−{-# LANGUAGE
1+{-# LANGUAGE
2 FlexibleContexts
2 FlexibleContexts
3, GeneralizedNewtypeDeriving
3, GeneralizedNewtypeDeriving
4, TypeSynonymInstances
4, TypeSynonymInstances
@@ -100,7 +100,7 @@ module Text.Pandoc.Parsing ( anyLine,
100 macro,
100 macro,
101 applyMacros',
101 applyMacros',
102 Parser,
102 Parser,
103− ParserT,
103+ ParserT,
104 F(..),
104 F(..),
105 runF,
105 runF,
106 askF,
106 askF,
@@ -222,7 +222,7 @@ anyLine = do
222 _ -> mzero
222 _ -> mzero
223
223
224-- | Like @manyTill@, but reads at least one item.
224-- | Like @manyTill@, but reads at least one item.
225−many1Till :: Stream s m t
225+many1Till :: Stream s m t
226 => ParserT s st m a
226 => ParserT s st m a
227 -> ParserT s st m end
227 -> ParserT s st m end
228 -> ParserT s st m [a]
228 -> ParserT s st m [a]
@@ -501,7 +501,7 @@ mathInline =
501-- displacement (the difference between the source column at the end
501-- displacement (the difference between the source column at the end
502-- and the source column at the beginning). Vertical displacement
502-- and the source column at the beginning). Vertical displacement
503-- (source row) is ignored.
503-- (source row) is ignored.
504−withHorizDisplacement :: Stream s m Char
504+withHorizDisplacement :: Stream s m Char
505 => ParserT s st m a -- ^ Parser to apply
505 => ParserT s st m a -- ^ Parser to apply
506 -> ParserT s st m (a, Int) -- ^ (result, displacement)
506 -> ParserT s st m (a, Int) -- ^ (result, displacement)
507withHorizDisplacement parser = do
507withHorizDisplacement parser = do
@@ -528,7 +528,7 @@ withRaw parser = do
528 return (result, raw)
528 return (result, raw)
529
529
530-- | Parses backslash, then applies character parser.
530-- | Parses backslash, then applies character parser.
531−escaped :: Stream s m Char
531+escaped :: Stream s m Char
532 => ParserT s st m Char -- ^ Parser for character to escape
532 => ParserT s st m Char -- ^ Parser for character to escape
533 -> ParserT s st m Char
533 -> ParserT s st m Char
534escaped parser = try $ char '\\' >> parser
534escaped parser = try $ char '\\' >> parser
@@ -564,7 +564,7 @@ decimal = do
564-- returns (DefaultStyle, [next example number]). The next
564-- returns (DefaultStyle, [next example number]). The next
565-- example number is incremented in parser state, and the label
565-- example number is incremented in parser state, and the label
566-- (if present) is added to the label table.
566-- (if present) is added to the label table.
567−exampleNum :: Stream s m Char
567+exampleNum :: Stream s m Char
568 => ParserT s ParserState m (ListNumberStyle, Int)
568 => ParserT s ParserState m (ListNumberStyle, Int)
569exampleNum = do
569exampleNum = do
570 char '@'
570 char '@'
@@ -609,7 +609,7 @@ anyOrderedListMarker = choice $
609 lowerAlpha, lowerRoman, upperAlpha, upperRoman]]
609 lowerAlpha, lowerRoman, upperAlpha, upperRoman]]
610
610
611-- | Parses a list number (num) followed by a period, returns list attributes.
611-- | Parses a list number (num) followed by a period, returns list attributes.
612−inPeriod :: Stream s m Char
612+inPeriod :: Stream s m Char
613 => ParserT s st m (ListNumberStyle, Int)
613 => ParserT s st m (ListNumberStyle, Int)
614 -> ParserT s st m ListAttributes
614 -> ParserT s st m ListAttributes
615inPeriod num = try $ do
615inPeriod num = try $ do
@@ -621,7 +621,7 @@ inPeriod num = try $ do
621 return (start, style, delim)
621 return (start, style, delim)
622
622
623-- | Parses a list number (num) followed by a paren, returns list attributes.
623-- | Parses a list number (num) followed by a paren, returns list attributes.
624−inOneParen :: Stream s m Char
624+inOneParen :: Stream s m Char
625 => ParserT s st m (ListNumberStyle, Int)
625 => ParserT s st m (ListNumberStyle, Int)
626 -> ParserT s st m ListAttributes
626 -> ParserT s st m ListAttributes
627inOneParen num = try $ do
627inOneParen num = try $ do
@@ -630,7 +630,7 @@ inOneParen num = try $ do
630 return (start, style, OneParen)
630 return (start, style, OneParen)
631
631
632-- | Parses a list number (num) enclosed in parens, returns list attributes.
632-- | Parses a list number (num) enclosed in parens, returns list attributes.
633−inTwoParens :: Stream s m Char
633+inTwoParens :: Stream s m Char
634 => ParserT s st m (ListNumberStyle, Int)
634 => ParserT s st m (ListNumberStyle, Int)
635 -> ParserT s st m ListAttributes
635 -> ParserT s st m ListAttributes
636inTwoParens num = try $ do
636inTwoParens num = try $ do
@@ -641,7 +641,7 @@ inTwoParens num = try $ do
641
641
642-- | Parses an ordered list marker with a given style and delimiter,
642-- | Parses an ordered list marker with a given style and delimiter,
643-- returns number.
643-- returns number.
644−orderedListMarker :: Stream s m Char
644+orderedListMarker :: Stream s m Char
645 => ListNumberStyle
645 => ListNumberStyle
646 -> ListNumberDelim
646 -> ListNumberDelim
647 -> ParserT s ParserState m Int
647 -> ParserT s ParserState m Int
@@ -688,7 +688,7 @@ lineBlockLines = try $ do
688
688
689-- | Parse a table using 'headerParser', 'rowParser',
689-- | Parse a table using 'headerParser', 'rowParser',
690-- 'lineParser', and 'footerParser'.
690-- 'lineParser', and 'footerParser'.
691−tableWith :: Stream s m Char
691+tableWith :: Stream s m Char
692 => ParserT s ParserState m ([[Block]], [Alignment], [Int])
692 => ParserT s ParserState m ([[Block]], [Alignment], [Int])
693 -> ([Int] -> ParserT s ParserState m [[Block]])
693 -> ([Int] -> ParserT s ParserState m [[Block]])
694 -> ParserT s ParserState m sep
694 -> ParserT s ParserState m sep
@@ -735,7 +735,7 @@ widthsFromIndices numColumns' indices =
735-- (which may be grid), then the rows,
735-- (which may be grid), then the rows,
736-- which may be grid, separated by blank lines, and
736-- which may be grid, separated by blank lines, and
737-- ending with a footer (dashed line followed by blank line).
737-- ending with a footer (dashed line followed by blank line).
738−gridTableWith :: Stream [Char] m Char
738+gridTableWith :: Stream [Char] m Char
739 => ParserT [Char] ParserState m [Block] -- ^ Block list parser
739 => ParserT [Char] ParserState m [Block] -- ^ Block list parser
740 -> Bool -- ^ Headerless table
740 -> Bool -- ^ Headerless table
741 -> ParserT [Char] ParserState m Block
741 -> ParserT [Char] ParserState m Block
@@ -765,7 +765,7 @@ gridTableSep :: Stream s m Char => Char -> ParserT s ParserState m Char
765gridTableSep ch = try $ gridDashedLines ch >> return '\n'
765gridTableSep ch = try $ gridDashedLines ch >> return '\n'
766
766
767-- | Parse header for a grid table.
767-- | Parse header for a grid table.
768−gridTableHeader :: Stream [Char] m Char
768+gridTableHeader :: Stream [Char] m Char
769 => Bool -- ^ Headerless table
769 => Bool -- ^ Headerless table
770 -> ParserT [Char] ParserState m [Block]
770 -> ParserT [Char] ParserState m [Block]
771 -> ParserT [Char] ParserState m ([[Block]], [Alignment], [Int])
771 -> ParserT [Char] ParserState m ([[Block]], [Alignment], [Int])
@@ -798,7 +798,7 @@ gridTableRawLine indices = do
798 return (gridTableSplitLine indices line)
798 return (gridTableSplitLine indices line)
799
799
800-- | Parse row of grid table.
800-- | Parse row of grid table.
801−gridTableRow :: Stream [Char] m Char
801+gridTableRow :: Stream [Char] m Char
802 => ParserT [Char] ParserState m [Block]
802 => ParserT [Char] ParserState m [Block]
803 -> [Int]
803 -> [Int]
804 -> ParserT [Char] ParserState m [[Block]]
804 -> ParserT [Char] ParserState m [[Block]]
@@ -826,7 +826,7 @@ gridTableFooter = blanklines
826---
826---
827
827
828-- | Parse a string with a given parser and state.
828-- | 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)
830 => ParserT s st Identity a -- ^ parser
830 => ParserT s st Identity a -- ^ parser
831 -> st -- ^ initial state
831 -> st -- ^ initial state
832 -> s -- ^ input
832 -> s -- ^ input
@@ -844,7 +844,7 @@ readWith parser state input =
844 Right result -> result
844 Right result -> result
845
845
846-- | Parse a string with @parser@ (for testing).
846-- | 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)
848 => ParserT s ParserState Identity a
848 => ParserT s ParserState Identity a
849 -> s
849 -> s
850 -> IO ()
850 -> IO ()
@@ -1038,7 +1038,7 @@ registerHeader (ident,classes,kvs) header' = do
1038failUnlessSmart :: (Stream s m a, HasReaderOptions st) => ParserT s st m ()
1038failUnlessSmart :: (Stream s m a, HasReaderOptions st) => ParserT s st m ()
1039failUnlessSmart = getOption readerSmart >>= guard
1039failUnlessSmart = getOption readerSmart >>= guard
1040
1040
1041−smartPunctuation :: Stream s m Char
1041+smartPunctuation :: Stream s m Char
1042 => ParserT s ParserState m Inlines
1042 => ParserT s ParserState m Inlines
1043 -> ParserT s ParserState m Inlines
1043 -> ParserT s ParserState m Inlines
1044smartPunctuation inlineParser = do
1044smartPunctuation inlineParser = do
@@ -1048,12 +1048,12 @@ smartPunctuation inlineParser = do
1048apostrophe :: Stream s m Char => ParserT s st m Inlines
1048apostrophe :: Stream s m Char => ParserT s st m Inlines
1049apostrophe = (char '\'' <|> char '\8217') >> return (B.str "\x2019")
1049apostrophe = (char '\'' <|> char '\8217') >> return (B.str "\x2019")
1050
1050
1051−quoted :: Stream s m Char
1051+quoted :: Stream s m Char
1052 => ParserT s ParserState m Inlines
1052 => ParserT s ParserState m Inlines
1053 -> ParserT s ParserState m Inlines
1053 -> ParserT s ParserState m Inlines
1054quoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser
1054quoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser
1055
1055
1056−withQuoteContext :: Stream s m t
1056+withQuoteContext :: Stream s m t
1057 => QuoteContext
1057 => QuoteContext
1058 -> ParserT s ParserState m a
1058 -> ParserT s ParserState m a
1059 -> ParserT s ParserState m a
1059 -> ParserT s ParserState m a
@@ -1066,7 +1066,7 @@ withQuoteContext context parser = do
1066 setState newState { stateQuoteContext = oldQuoteContext }
1066 setState newState { stateQuoteContext = oldQuoteContext }
1067 return result
1067 return result
1068
1068
1069−singleQuoted :: Stream s m Char
1069+singleQuoted :: Stream s m Char
1070 => ParserT s ParserState m Inlines
1070 => ParserT s ParserState m Inlines
1071 -> ParserT s ParserState m Inlines
1071 -> ParserT s ParserState m Inlines
1072singleQuoted inlineParser = try $ do
1072singleQuoted inlineParser = try $ do
@@ -1074,7 +1074,7 @@ singleQuoted inlineParser = try $ do
1074 withQuoteContext InSingleQuote $ many1Till inlineParser singleQuoteEnd >>=
1074 withQuoteContext InSingleQuote $ many1Till inlineParser singleQuoteEnd >>=
1075 return . B.singleQuoted . mconcat
1075 return . B.singleQuoted . mconcat
1076
1076
1077−doubleQuoted :: Stream s m Char
1077+doubleQuoted :: Stream s m Char
1078 => ParserT s ParserState m Inlines
1078 => ParserT s ParserState m Inlines
1079 -> ParserT s ParserState m Inlines
1079 -> ParserT s ParserState m Inlines
1080doubleQuoted inlineParser = try $ do
1080doubleQuoted inlineParser = try $ do
@@ -1082,8 +1082,8 @@ doubleQuoted inlineParser = try $ do
1082 withQuoteContext InDoubleQuote $ manyTill inlineParser doubleQuoteEnd >>=
1082 withQuoteContext InDoubleQuote $ manyTill inlineParser doubleQuoteEnd >>=
1083 return . B.doubleQuoted . mconcat
1083 return . B.doubleQuoted . mconcat
1084
1084
1085−failIfInQuoteContext :: Stream s m t
1085+failIfInQuoteContext :: Stream s m t
1086− => QuoteContext
1086+ => QuoteContext
1087 -> ParserT s ParserState m ()
1087 -> ParserT s ParserState m ()
1088failIfInQuoteContext context = do
1088failIfInQuoteContext context = do
1089 st <- getState
1089 st <- getState
@@ -1097,7 +1097,7 @@ charOrRef cs =
1097 guard (c `elem` cs)
1097 guard (c `elem` cs)
1098 return c)
1098 return c)
1099
1099
1100−singleQuoteStart :: Stream s m Char
1100+singleQuoteStart :: Stream s m Char
1101 => ParserT s ParserState m ()
1101 => ParserT s ParserState m ()
1102singleQuoteStart = do
1102singleQuoteStart = do
1103 failIfInQuoteContext InSingleQuote
1103 failIfInQuoteContext InSingleQuote
@@ -1105,24 +1105,24 @@ singleQuoteStart = do
1105 guard =<< notAfterString
1105 guard =<< notAfterString
1106 () <$ charOrRef "'\8216\145"
1106 () <$ charOrRef "'\8216\145"
1107
1107
1108−singleQuoteEnd :: Stream s m Char
1108+singleQuoteEnd :: Stream s m Char
1109 => ParserT s st m ()
1109 => ParserT s st m ()
1110singleQuoteEnd = try $ do
1110singleQuoteEnd = try $ do
1111 charOrRef "'\8217\146"
1111 charOrRef "'\8217\146"
1112 notFollowedBy alphaNum
1112 notFollowedBy alphaNum
1113
1113
1114−doubleQuoteStart :: Stream s m Char
1114+doubleQuoteStart :: Stream s m Char
1115 => ParserT s ParserState m ()
1115 => ParserT s ParserState m ()
1116doubleQuoteStart = do
1116doubleQuoteStart = do
1117 failIfInQuoteContext InDoubleQuote
1117 failIfInQuoteContext InDoubleQuote
1118 try $ do charOrRef "\"\8220\147"
1118 try $ do charOrRef "\"\8220\147"
1119 notFollowedBy . satisfy $ flip elem [' ', '\t', '\n']
1119 notFollowedBy . satisfy $ flip elem [' ', '\t', '\n']
1120
1120
1121−doubleQuoteEnd :: Stream s m Char
1121+doubleQuoteEnd :: Stream s m Char
1122 => ParserT s st m ()
1122 => ParserT s st m ()
1123doubleQuoteEnd = void (charOrRef "\"\8221\148")
1123doubleQuoteEnd = void (charOrRef "\"\8221\148")
1124
1124
1125−ellipses :: Stream s m Char
1125+ellipses :: Stream s m Char
1126 => ParserT s st m Inlines
1126 => ParserT s st m Inlines
1127ellipses = do
1127ellipses = do
1128 try (charOrRef "\8230\133") <|> try (string "..." >> return '…')
1128 try (charOrRef "\8230\133") <|> try (string "..." >> return '…')
@@ -1136,32 +1136,32 @@ dash = do
1136 else B.str <$> (hyphenDash <|> emDash <|> enDash)
1136 else B.str <$> (hyphenDash <|> emDash <|> enDash)
1137
1137
1138-- Two hyphens = en-dash, three = em-dash
1138-- Two hyphens = en-dash, three = em-dash
1139−hyphenDash :: Stream s m Char
1139+hyphenDash :: Stream s m Char
1140 => ParserT s st m String
1140 => ParserT s st m String
1141hyphenDash = do
1141hyphenDash = do
1142 try $ string "--"
1142 try $ string "--"
1143 option "\8211" (char '-' >> return "\8212")
1143 option "\8211" (char '-' >> return "\8212")
1144
1144
1145−emDash :: Stream s m Char
1145+emDash :: Stream s m Char
1146 => ParserT s st m String
1146 => ParserT s st m String
1147emDash = do
1147emDash = do
1148 try (charOrRef "\8212\151")
1148 try (charOrRef "\8212\151")
1149 return "\8212"
1149 return "\8212"
1150
1150
1151−enDash :: Stream s m Char
1151+enDash :: Stream s m Char
1152 => ParserT s st m String
1152 => ParserT s st m String
1153enDash = do
1153enDash = do
1154 try (charOrRef "\8212\151")
1154 try (charOrRef "\8212\151")
1155 return "\8211"
1155 return "\8211"
1156
1156
1157−enDashOld :: Stream s m Char
1157+enDashOld :: Stream s m Char
1158 => ParserT s st m Inlines
1158 => ParserT s st m Inlines
1159enDashOld = do
1159enDashOld = do
1160 try (charOrRef "\8211\150") <|>
1160 try (charOrRef "\8211\150") <|>
1161 try (char '-' >> lookAhead (satisfy isDigit) >> return '–')
1161 try (char '-' >> lookAhead (satisfy isDigit) >> return '–')
1162 return (B.str "\8211")
1162 return (B.str "\8211")
1163
1163
1164−emDashOld :: Stream s m Char
1164+emDashOld :: Stream s m Char
1165 => ParserT s st m Inlines
1165 => ParserT s st m Inlines
1166emDashOld = do
1166emDashOld = do
1167 try (charOrRef "\8212\151") <|> (try $ string "--" >> optional (char '-') >> return '-')
1167 try (charOrRef "\8212\151") <|> (try $ string "--" >> optional (char '-') >> return '-')
@@ -1169,7 +1169,7 @@ emDashOld = do
1169
1169
1170-- This is used to prevent exponential blowups for things like:
1170-- This is used to prevent exponential blowups for things like:
1171-- a**a*a**a*a**a*a**a*a**a*a**a*a**
1171-- 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
1173 => ParserT s ParserState m a
1173 => ParserT s ParserState m a
1174 -> ParserT s ParserState m a
1174 -> ParserT s ParserState m a
1175nested p = do
1175nested p = do
@@ -1198,7 +1198,7 @@ citeKey = try $ do
1198--
1198--
1199
1199
1200-- | Parse a \newcommand or \renewcommand macro definition.
1200-- | 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)
1202 => ParserT [Char] st m Blocks
1202 => ParserT [Char] st m Blocks
1203macro = do
1203macro = do
1204 apply <- getOption readerApplyMacros
1204 apply <- getOption readerApplyMacros
@@ -1214,8 +1214,8 @@ macro = do
1214 else return $ rawBlock "latex" def'
1214 else return $ rawBlock "latex" def'
1215
1215
1216-- | Apply current macros to string.
1216-- | Apply current macros to string.
1217−applyMacros' :: Stream [Char] m Char
1217+applyMacros' :: Stream [Char] m Char
1218− => String
1218+ => String
1219 -> ParserT [Char] ParserState m String
1219 -> ParserT [Char] ParserState m String
1220applyMacros' target = do
1220applyMacros' target = do
1221 apply <- getOption readerApplyMacros
1221 apply <- getOption readerApplyMacros
src/Text/Pandoc/Readers/Docx.hs+9−9
@@ -150,7 +150,7 @@ runStyleToContainers rPr =
150 classContainers = case rStyle rPr of
150 classContainers = case rStyle rPr of
151 Nothing -> []
151 Nothing -> []
152 Just s -> spanClassToContainers s
152 Just s -> spanClassToContainers s
153−
153+
154 formatters = map Container $ mapMaybe id
154 formatters = map Container $ mapMaybe id
155 [ if isBold rPr then (Just Strong) else Nothing
155 [ if isBold rPr then (Just Strong) else Nothing
156 , if isItalic rPr then (Just Emph) else Nothing
156 , if isItalic rPr then (Just Emph) else Nothing
@@ -188,7 +188,7 @@ parStyleToContainers pPr | (c:cs) <- pStyle pPr, c `elem` blockQuoteDivs =
188parStyleToContainers pPr | (_:cs) <- pStyle pPr =
188parStyleToContainers pPr | (_:cs) <- pStyle pPr =
189 let pPr' = pPr { pStyle = cs}
189 let pPr' = pPr { pStyle = cs}
190 in
190 in
191− parStyleToContainers pPr'
191+ parStyleToContainers pPr'
192parStyleToContainers pPr | null (pStyle pPr),
192parStyleToContainers pPr | null (pStyle pPr),
193 Just left <- indentation pPr >>= leftParIndent,
193 Just left <- indentation pPr >>= leftParIndent,
194 Just hang <- indentation pPr >>= hangingParIndent =
194 Just hang <- indentation pPr >>= hangingParIndent =
@@ -205,7 +205,7 @@ parStyleToContainers pPr | null (pStyle pPr),
205 True -> (Container BlockQuote) : (parStyleToContainers pPr')
205 True -> (Container BlockQuote) : (parStyleToContainers pPr')
206 False -> parStyleToContainers pPr'
206 False -> parStyleToContainers pPr'
207parStyleToContainers _ = []
207parStyleToContainers _ = []
208−
208+
209
209
210strToInlines :: String -> [Inline]
210strToInlines :: String -> [Inline]
211strToInlines = toList . text
211strToInlines = toList . text
@@ -258,9 +258,9 @@ runToInlines (Run rs runElems)
258 | otherwise =
258 | otherwise =
259 return $
259 return $
260 rebuild (runStyleToContainers rs) (concatMap runElemToInlines runElems)
260 rebuild (runStyleToContainers rs) (concatMap runElemToInlines runElems)
261−runToInlines (Footnote bps) =
261+runToInlines (Footnote bps) =
262 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
262 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
263−runToInlines (Endnote bps) =
263+runToInlines (Endnote bps) =
264 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
264 concatMapM bodyPartToBlocks bps >>= (\blks -> return [Note blks])
265
265
266makeDataUrl :: String -> B.ByteString -> Maybe String
266makeDataUrl :: String -> B.ByteString -> Maybe String
@@ -343,7 +343,7 @@ oMathElemToTexString (Bar style base) = do
343 Top -> printf "\\overline{%s}" baseString
343 Top -> printf "\\overline{%s}" baseString
344 Bottom -> printf "\\underline{%s}" baseString
344 Bottom -> printf "\\underline{%s}" baseString
345oMathElemToTexString (Box base) = baseToTexString base
345oMathElemToTexString (Box base) = baseToTexString base
346−oMathElemToTexString (BorderBox base) =
346+oMathElemToTexString (BorderBox base) =
347 baseToTexString base >>= (\s -> return $ printf "\\boxed{%s}" s)
347 baseToTexString base >>= (\s -> return $ printf "\\boxed{%s}" s)
348oMathElemToTexString (Delimiter dPr bases) = do
348oMathElemToTexString (Delimiter dPr bases) = do
349 let beg = fromMaybe '(' (delimBegChar dPr)
349 let beg = fromMaybe '(' (delimBegChar dPr)
@@ -474,7 +474,7 @@ oMathElemToTexString (OMathRun _ run) = return $ stringToTex $ runToString run
474baseToTexString :: Base -> DocxContext String
474baseToTexString :: Base -> DocxContext String
475baseToTexString (Base mathElems) =
475baseToTexString (Base mathElems) =
476 concatMapM oMathElemToTexString mathElems
476 concatMapM oMathElemToTexString mathElems
477−
477+
478
478
479isAnchorSpan :: Inline -> Bool
479isAnchorSpan :: Inline -> Bool
480isAnchorSpan (Span (ident, classes, kvs) ils) =
480isAnchorSpan (Span (ident, classes, kvs) ils) =
@@ -535,7 +535,7 @@ bodyPartToBlocks (Paragraph pPr parparts)
535 let
535 let
536 otherConts = filter (not . isBlockCodeContainer) (parStyleToContainers pPr)
536 otherConts = filter (not . isBlockCodeContainer) (parStyleToContainers pPr)
537 in
537 in
538− return $
538+ return $
539 rebuild
539 rebuild
540 otherConts
540 otherConts
541 [CodeBlock ("", [], []) (concatMap parPartToString parparts)]
541 [CodeBlock ("", [], []) (concatMap parPartToString parparts)]
@@ -582,7 +582,7 @@ bodyPartToBlocks (Tbl cap _ look (r:rs)) = do
582 hdrCells <- case hdr of
582 hdrCells <- case hdr of
583 Just r' -> rowToBlocksList r'
583 Just r' -> rowToBlocksList r'
584 Nothing -> return []
584 Nothing -> return []
585−
585+
586 cells <- mapM rowToBlocksList rows
586 cells <- mapM rowToBlocksList rows
587
587
588 let size = case null hdrCells of
588 let size = case null hdrCells of
src/Text/Pandoc/Readers/Docx/Lists.hs+7−7
@@ -121,7 +121,7 @@ handleListParagraphs (
121 in
121 in
122 handleListParagraphs ((Div attr1 (blks1 ++ [newDiv2])) : blks)
122 handleListParagraphs ((Div attr1 (blks1 ++ [newDiv2])) : blks)
123handleListParagraphs (blk:blks) = blk : (handleListParagraphs blks)
123handleListParagraphs (blk:blks) = blk : (handleListParagraphs blks)
124−
124+
125separateBlocks' :: Block -> [[Block]] -> [[Block]]
125separateBlocks' :: Block -> [[Block]] -> [[Block]]
126separateBlocks' blk ([] : []) = [[blk]]
126separateBlocks' blk ([] : []) = [[blk]]
127separateBlocks' b@(BulletList _) acc = (init acc) ++ [(last acc) ++ [b]]
127separateBlocks' b@(BulletList _) acc = (init acc) ++ [(last acc) ++ [b]]
@@ -139,7 +139,7 @@ flatToBullets' :: Integer -> [Block] -> [Block]
139flatToBullets' _ [] = []
139flatToBullets' _ [] = []
140flatToBullets' num xs@(b : elems)
140flatToBullets' num xs@(b : elems)
141 | getLevelN b == num = b : (flatToBullets' num elems)
141 | getLevelN b == num = b : (flatToBullets' num elems)
142− | otherwise =
142+ | otherwise =
143 let bNumId = getNumIdN b
143 let bNumId = getNumIdN b
144 bLevel = getLevelN b
144 bLevel = getLevelN b
145 (children, remaining) =
145 (children, remaining) =
@@ -162,7 +162,7 @@ flatToBullets elems = flatToBullets' (-1) elems
162
162
163blocksToBullets :: [Block] -> [Block]
163blocksToBullets :: [Block] -> [Block]
164blocksToBullets blks =
164blocksToBullets blks =
165− bottomUp removeListDivs $
165+ bottomUp removeListDivs $
166 flatToBullets $ (handleListParagraphs blks)
166 flatToBullets $ (handleListParagraphs blks)
167
167
168plainParaInlines :: Block -> [Inline]
168plainParaInlines :: Block -> [Inline]
@@ -216,12 +216,12 @@ removeListDivs' blk = [blk]
216
216
217removeListDivs :: [Block] -> [Block]
217removeListDivs :: [Block] -> [Block]
218removeListDivs = concatMap removeListDivs'
218removeListDivs = concatMap removeListDivs'
219−
219+
220
220
221
221
222blocksToDefinitions :: [Block] -> [Block]
222blocksToDefinitions :: [Block] -> [Block]
223blocksToDefinitions = blocksToDefinitions' [] []
223blocksToDefinitions = blocksToDefinitions' [] []
224
224
225−
225+
226−
226+
227−
227+
src/Text/Pandoc/Readers/Docx/Parse.hs+24−24
@@ -106,7 +106,7 @@ type NameSpaces = [(String, String)]
106data Docx = Docx Document
106data Docx = Docx Document
107 deriving Show
107 deriving Show
108
108
109−data Document = Document NameSpaces Body
109+data Document = Document NameSpaces Body
110 deriving Show
110 deriving Show
111
111
112data Body = Body [BodyPart]
112data Body = Body [BodyPart]
@@ -276,7 +276,7 @@ defaultRunStyle = RunStyle { isBold = False
276 , isSubScript = False
276 , isSubScript = False
277 , rUnderline = Nothing
277 , rUnderline = Nothing
278 , rStyle = Nothing
278 , rStyle = Nothing
279− }
279+ }
280
280
281
281
282type Target = String
282type Target = String
@@ -286,7 +286,7 @@ type BookMarkId = String
286type RelId = String
286type RelId = String
287type ChangeId = String
287type ChangeId = String
288type Author = String
288type Author = String
289−type ChangeDate = String
289+type ChangeDate = String
290
290
291attrToNSPair :: Attr -> Maybe (String, String)
291attrToNSPair :: Attr -> Maybe (String, String)
292attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)
292attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)
@@ -301,18 +301,18 @@ archiveToDocx archive = do
301 rEnv = ReaderEnv notes numbering rels media
301 rEnv = ReaderEnv notes numbering rels media
302 doc <- runD (archiveToDocument archive) rEnv
302 doc <- runD (archiveToDocument archive) rEnv
303 return $ Docx doc
303 return $ Docx doc
304−
304+
305
305
306archiveToDocument :: Archive -> D Document
306archiveToDocument :: Archive -> D Document
307archiveToDocument zf = do
307archiveToDocument zf = do
308 entry <- maybeToD $ findEntryByPath "word/document.xml" zf
308 entry <- maybeToD $ findEntryByPath "word/document.xml" zf
309 docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry
309 docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry
310− let namespaces = mapMaybe attrToNSPair (elAttribs docElem)
310+ let namespaces = mapMaybe attrToNSPair (elAttribs docElem)
311 bodyElem <- maybeToD $ findChild (elemName namespaces "w" "body") docElem
311 bodyElem <- maybeToD $ findChild (elemName namespaces "w" "body") docElem
312 body <- elemToBody namespaces bodyElem
312 body <- elemToBody namespaces bodyElem
313 return $ Document namespaces body
313 return $ Document namespaces body
314
314
315−elemToBody :: NameSpaces -> Element -> D Body
315+elemToBody :: NameSpaces -> Element -> D Body
316elemToBody ns element | isElem ns "w" "body" element =
316elemToBody ns element | isElem ns "w" "body" element =
317 mapD (elemToBodyPart ns) (elChildren element) >>=
317 mapD (elemToBodyPart ns) (elChildren element) >>=
318 (\bps -> return $ Body bps)
318 (\bps -> return $ Body bps)
@@ -349,10 +349,10 @@ relElemToRelationship element | qName (elName element) == "Relationship" =
349 target <- findAttr (QName "Target" Nothing Nothing) element
349 target <- findAttr (QName "Target" Nothing Nothing) element
350 return $ Relationship (relId, target)
350 return $ Relationship (relId, target)
351relElemToRelationship _ = Nothing
351relElemToRelationship _ = Nothing
352−
352+
353
353
354archiveToRelationships :: Archive -> [Relationship]
354archiveToRelationships :: Archive -> [Relationship]
355−archiveToRelationships archive =
355+archiveToRelationships archive =
356 let relPaths = filter filePathIsRel (filesInArchive archive)
356 let relPaths = filter filePathIsRel (filesInArchive archive)
357 entries = mapMaybe (\f -> findEntryByPath f archive) relPaths
357 entries = mapMaybe (\f -> findEntryByPath f archive) relPaths
358 relElems = mapMaybe (parseXMLDoc . UTF8.toStringLazy . fromEntry) entries
358 relElems = mapMaybe (parseXMLDoc . UTF8.toStringLazy . fromEntry) entries
@@ -445,7 +445,7 @@ archiveToNumbering archive =
445
445
446elemToNotes :: NameSpaces -> String -> Element -> Maybe (M.Map String Element)
446elemToNotes :: NameSpaces -> String -> Element -> Maybe (M.Map String Element)
447elemToNotes ns notetype element
447elemToNotes ns notetype element
448− | isElem ns "w" (notetype ++ "s") element =
448+ | isElem ns "w" (notetype ++ "s") element =
449 let pairs = mapMaybe
449 let pairs = mapMaybe
450 (\e -> findAttr (elemName ns "w" "id") e >>=
450 (\e -> findAttr (elemName ns "w" "id") e >>=
451 (\a -> Just (a, e)))
451 (\a -> Just (a, e)))
@@ -478,7 +478,7 @@ elemToTblLook :: NameSpaces -> Element -> D TblLook
478elemToTblLook ns element | isElem ns "w" "tblLook" element =
478elemToTblLook ns element | isElem ns "w" "tblLook" element =
479 let firstRow = findAttr (elemName ns "w" "firstRow") element
479 let firstRow = findAttr (elemName ns "w" "firstRow") element
480 val = findAttr (elemName ns "w" "val") element
480 val = findAttr (elemName ns "w" "val") element
481− firstRowFmt =
481+ firstRowFmt =
482 case firstRow of
482 case firstRow of
483 Just "1" -> True
483 Just "1" -> True
484 Just _ -> False
484 Just _ -> False
@@ -505,15 +505,15 @@ elemToCell ns element | isElem ns "w" "tc" element =
505elemToCell _ _ = throwError WrongElem
505elemToCell _ _ = throwError WrongElem
506
506
507elemToParIndentation :: NameSpaces -> Element -> Maybe ParIndentation
507elemToParIndentation :: NameSpaces -> Element -> Maybe ParIndentation
508−elemToParIndentation ns element | isElem ns "w" "ind" element =
508+elemToParIndentation ns element | isElem ns "w" "ind" element =
509 Just $ ParIndentation {
509 Just $ ParIndentation {
510 leftParIndent =
510 leftParIndent =
511 findAttr (QName "left" (lookup "w" ns) (Just "w")) element >>=
511 findAttr (QName "left" (lookup "w" ns) (Just "w")) element >>=
512 stringToInteger
512 stringToInteger
513− , rightParIndent =
513+ , rightParIndent =
514 findAttr (QName "right" (lookup "w" ns) (Just "w")) element >>=
514 findAttr (QName "right" (lookup "w" ns) (Just "w")) element >>=
515 stringToInteger
515 stringToInteger
516− , hangingParIndent =
516+ , hangingParIndent =
517 findAttr (QName "hanging" (lookup "w" ns) (Just "w")) element >>=
517 findAttr (QName "hanging" (lookup "w" ns) (Just "w")) element >>=
518 stringToInteger}
518 stringToInteger}
519elemToParIndentation _ _ = Nothing
519elemToParIndentation _ _ = Nothing
@@ -558,7 +558,7 @@ elemToBodyPart ns element
558 case lookupLevel numId lvl num of
558 case lookupLevel numId lvl num of
559 Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts
559 Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts
560 Nothing -> throwError WrongElem
560 Nothing -> throwError WrongElem
561−elemToBodyPart ns element
561+elemToBodyPart ns element
562 | isElem ns "w" "p" element = do
562 | isElem ns "w" "p" element = do
563 let parstyle = elemToParagraphStyle ns element
563 let parstyle = elemToParagraphStyle ns element
564 parparts <- mapD (elemToParPart ns) (elChildren element)
564 parparts <- mapD (elemToParPart ns) (elChildren element)
@@ -667,15 +667,15 @@ elemToMathElem ns element | isElem ns "m" "bar" element = do
667 base <-maybeToD (findChild (QName "e" (lookup "m" ns) (Just "m")) element) >>=
667 base <-maybeToD (findChild (QName "e" (lookup "m" ns) (Just "m")) element) >>=
668 elemToBase ns
668 elemToBase ns
669 return $ Bar barPr base
669 return $ Bar barPr base
670−elemToMathElem ns element | isElem ns "m" "box" element =
670+elemToMathElem ns element | isElem ns "m" "box" element =
671 maybeToD (findChild (elemName ns "m" "e") element) >>=
671 maybeToD (findChild (elemName ns "m" "e") element) >>=
672 elemToBase ns >>=
672 elemToBase ns >>=
673 (\b -> return $ Box b)
673 (\b -> return $ Box b)
674−elemToMathElem ns element | isElem ns "m" "borderBox" element =
674+elemToMathElem ns element | isElem ns "m" "borderBox" element =
675 maybeToD (findChild (elemName ns "m" "e") element) >>=
675 maybeToD (findChild (elemName ns "m" "e") element) >>=
676 elemToBase ns >>=
676 elemToBase ns >>=
677 (\b -> return $ BorderBox b)
677 (\b -> return $ BorderBox b)
678−elemToMathElem ns element | isElem ns "m" "d" element =
678+elemToMathElem ns element | isElem ns "m" "d" element =
679 let style = elemToDelimStyle ns element
679 let style = elemToDelimStyle ns element
680 in
680 in
681 mapD (elemToBase ns) (elChildren element) >>=
681 mapD (elemToBase ns) (elChildren element) >>=
@@ -684,8 +684,8 @@ elemToMathElem ns element | isElem ns "m" "eqArr" element =
684 mapD (elemToBase ns) (elChildren element) >>=
684 mapD (elemToBase ns) (elChildren element) >>=
685 (\es -> return $ EquationArray es)
685 (\es -> return $ EquationArray es)
686elemToMathElem ns element | isElem ns "m" "f" element = do
686elemToMathElem ns element | isElem ns "m" "f" element = do
687− num <- maybeToD $ findChild (elemName ns "m" "num") element
687+ num <- maybeToD $ findChild (elemName ns "m" "num") element
688− den <- maybeToD $ findChild (elemName ns "m" "den") element
688+ den <- maybeToD $ findChild (elemName ns "m" "den") element
689 numElems <- mapD (elemToMathElem ns) (elChildren num)
689 numElems <- mapD (elemToMathElem ns) (elChildren num)
690 denElems <- mapD (elemToMathElem ns) (elChildren den)
690 denElems <- mapD (elemToMathElem ns) (elChildren den)
691 return $ Fraction numElems denElems
691 return $ Fraction numElems denElems
@@ -695,7 +695,7 @@ elemToMathElem ns element | isElem ns "m" "func" element = do
695 elemToBase ns
695 elemToBase ns
696 fnElems <- mapD (elemToMathElem ns) (elChildren fName)
696 fnElems <- mapD (elemToMathElem ns) (elChildren fName)
697 return $ Function fnElems base
697 return $ Function fnElems base
698−elemToMathElem ns element | isElem ns "m" "groupChr" element =
698+elemToMathElem ns element | isElem ns "m" "groupChr" element =
699 let style = elemToGroupStyle ns element
699 let style = elemToGroupStyle ns element
700 in
700 in
701 maybeToD (findChild (elemName ns "m" "e") element) >>=
701 maybeToD (findChild (elemName ns "m" "e") element) >>=
@@ -920,11 +920,11 @@ elemToRunElems ns element
920elemToRunElems _ _ = throwError WrongElem
920elemToRunElems _ _ = throwError WrongElem
921
921
922
922
923−
924−
925
923
926
924
927
925
928
926
929−
927+
930−
928+
929+
930+
src/Text/Pandoc/Readers/Docx/Reducible.hs+4−4
@@ -90,7 +90,7 @@ combineReducibles r s =
90 True -> case (not . null) rs && isSpace (last rs) of
90 True -> case (not . null) rs && isSpace (last rs) of
91 True -> rebuild conts (init rs) ++ [last rs, s]
91 True -> rebuild conts (init rs) ++ [last rs, s]
92 False -> [r,s]
92 False -> [r,s]
93− False -> rebuild
93+ False -> rebuild
94 shared $
94 shared $
95 reduceList $
95 reduceList $
96 (rebuild remaining rs) ++ (rebuild remaining' ss)
96 (rebuild remaining rs) ++ (rebuild remaining' ss)
@@ -145,7 +145,7 @@ instance Reducible Inline where
145 isSpace _ = False
145 isSpace _ = False
146
146
147instance Reducible Block where
147instance 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 =
149 [Div (ident, classes, kvs) (reduceList blks), blk]
149 [Div (ident, classes, kvs) (reduceList blks), blk]
150
150
151 blk <++> blk' = combineReducibles blk blk'
151 blk <++> blk' = combineReducibles blk blk'
@@ -177,5 +177,5 @@ rebuild :: [Container a] -> [a] -> [a]
177rebuild [] xs = xs
177rebuild [] xs = xs
178rebuild ((Container f) : cs) xs = rebuild cs $ [f xs]
178rebuild ((Container f) : cs) xs = rebuild cs $ [f xs]
179rebuild (NullContainer : cs) xs = rebuild cs $ xs
179rebuild (NullContainer : cs) xs = rebuild cs $ xs
180−
180+
181−
181+
src/Text/Pandoc/Readers/Docx/TexChar.hs+1−1
@@ -4382,5 +4382,5 @@ uniconvMap = M.fromList [ ('\8193', "\\quad")
4382-- , ('\120829', "\\mttseven")
4382-- , ('\120829', "\\mttseven")
4383-- , ('\120830', "\\mtteight")
4383-- , ('\120830', "\\mtteight")
4384-- , ('\120831', "\\mttnine")
4384-- , ('\120831', "\\mttnine")
4385−
4385+
4386-- ]
4386-- ]
src/Text/Pandoc/Shared.hs+2−2
@@ -335,10 +335,10 @@ isSpaceOrEmpty (Str "") = True
335isSpaceOrEmpty _ = False
335isSpaceOrEmpty _ = False
336
336
337-- | Extract the leading and trailing spaces from inside an inline element
337-- | 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.
339
339
340extractSpaces :: (Inlines -> Inlines) -> Inlines -> Inlines
340extractSpaces :: (Inlines -> Inlines) -> Inlines -> Inlines
341−extractSpaces f is =
341+extractSpaces f is =
342 let contents = B.unMany is
342 let contents = B.unMany is
343 left = case viewl contents of
343 left = case viewl contents of
344 (Space :< _) -> B.space
344 (Space :< _) -> B.space
src/Text/Pandoc/Writers/AsciiDoc.hs+4−4
@@ -142,10 +142,10 @@ blockToAsciiDoc opts (Header level (ident,_,_) inlines) = do
142 let len = offset contents
142 let len = offset contents
143 -- ident seem to be empty most of the time and asciidoc will generate them automatically
143 -- ident seem to be empty most of the time and asciidoc will generate them automatically
144 -- so lets make them not show up when null
144 -- 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 <> "]]")
146 let setext = writerSetextHeaders opts
146 let setext = writerSetextHeaders opts
147− return $
147+ return $
148− (if setext
148+ (if setext
149 then
149 then
150 identifier $$ contents $$
150 identifier $$ contents $$
151 (case level of
151 (case level of
@@ -155,7 +155,7 @@ blockToAsciiDoc opts (Header level (ident,_,_) inlines) = do
155 4 -> text $ replicate len '+'
155 4 -> text $ replicate len '+'
156 _ -> empty) <> blankline
156 _ -> empty) <> blankline
157 else
157 else
158− identifier $$ text (replicate level '=') <> space <> contents <> blankline)
158+ identifier $$ text (replicate level '=') <> space <> contents <> blankline)
159blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $
159blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $
160 flush (attrs <> dashes <> space <> attrs <> cr <> text str <>
160 flush (attrs <> dashes <> space <> attrs <> cr <> text str <>
161 cr <> dashes) <> blankline
161 cr <> dashes) <> blankline
src/Text/Pandoc/Writers/ICML.hs+4−4
@@ -42,7 +42,7 @@ type WS a = State WriterState a
42
42
43defaultWriterState :: WriterState
43defaultWriterState :: WriterState
44defaultWriterState = WriterState{
44defaultWriterState = WriterState{
45− blockStyles = Set.empty
45+ blockStyles = Set.empty
46 , inlineStyles = Set.empty
46 , inlineStyles = Set.empty
47 , links = []
47 , links = []
48 , listDepth = 1
48 , listDepth = 1
@@ -267,7 +267,7 @@ hyperlinksToDoc (x:xs) = hyp x $$ hyperlinksToDoc xs
267 $ inTags False "BorderColor" [("type","enumeration")] (text "Black")
267 $ inTags False "BorderColor" [("type","enumeration")] (text "Black")
268 $$ (inTags False "Destination" [("type","object")]
268 $$ (inTags False "Destination" [("type","object")]
269 $ text $ "HyperlinkURLDestination/"++(escapeStringForXML url))
269 $ text $ "HyperlinkURLDestination/"++(escapeStringForXML url))
270−
270+
271
271
272-- | Convert a list of Pandoc blocks to ICML.
272-- | Convert a list of Pandoc blocks to ICML.
273blocksToICML :: WriterOptions -> Style -> [Block] -> WS Doc
273blocksToICML :: WriterOptions -> Style -> [Block] -> WS Doc
@@ -352,7 +352,7 @@ listItemsToICML opts listType style attribs (first:rest) = do
352-- | Convert a list of blocks to ICML list items.
352-- | Convert a list of blocks to ICML list items.
353listItemToICML :: WriterOptions -> Style -> Bool-> Maybe ListAttributes -> [Block] -> WS Doc
353listItemToICML :: WriterOptions -> Style -> Bool-> Maybe ListAttributes -> [Block] -> WS Doc
354listItemToICML opts style isFirst attribs item =
354listItemToICML opts style isFirst attribs item =
355− let makeNumbStart (Just (beginsWith, numbStl, _)) =
355+ let makeNumbStart (Just (beginsWith, numbStl, _)) =
356 let doN DefaultStyle = []
356 let doN DefaultStyle = []
357 doN LowerRoman = [lowerRomanName]
357 doN LowerRoman = [lowerRomanName]
358 doN UpperRoman = [upperRomanName]
358 doN UpperRoman = [upperRomanName]
@@ -467,7 +467,7 @@ parStyle opts style lst =
467
467
468-- | Wrap a Doc in an ICML Character Style.
468-- | Wrap a Doc in an ICML Character Style.
469charStyle :: Style -> Doc -> WS Doc
469charStyle :: Style -> Doc -> WS Doc
470−charStyle style content =
470+charStyle style content =
471 let (stlStr, attrs) = styleToStrAttr style
471 let (stlStr, attrs) = styleToStrAttr style
472 doc = inTags True "CharacterStyleRange" attrs $ inTagsSimple "Content" $ flush content
472 doc = inTags True "CharacterStyleRange" attrs $ inTagsSimple "Content" $ flush content
473 in do
473 in do
src/Text/Pandoc/Writers/OpenDocument.hs+2−2
@@ -504,7 +504,7 @@ paraStyle parent attrs = do
504 tight = if t then [ ("fo:margin-top" , "0in" )
504 tight = if t then [ ("fo:margin-top" , "0in" )
505 , ("fo:margin-bottom" , "0in" )]
505 , ("fo:margin-bottom" , "0in" )]
506 else []
506 else []
507− indent = if (i /= 0 || b)
507+ indent = if (i /= 0 || b)
508 then [ ("fo:margin-left" , indentVal)
508 then [ ("fo:margin-left" , indentVal)
509 , ("fo:margin-right" , "0in" )
509 , ("fo:margin-right" , "0in" )
510 , ("fo:text-indent" , "0in" )
510 , ("fo:text-indent" , "0in" )
@@ -534,7 +534,7 @@ paraTableStyles t s (a:xs)
534 [ ("fo:text-align", x)
534 [ ("fo:text-align", x)
535 , ("style:justify-single-word", "false")]
535 , ("style:justify-single-word", "false")]
536
536
537−data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
537+data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
538 deriving ( Eq,Ord )
538 deriving ( Eq,Ord )
539
539
540textStyleAttr :: TextStyle -> [(String,String)]
540textStyleAttr :: 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
174 let alt = ":alt: " <> if null tit then capt else text tit
174 let alt = ":alt: " <> if null tit then capt else text tit
175 return $ hang 3 ".. " $ fig $$ alt $+$ capt $$ blankline
175 return $ hang 3 ".. " $ fig $$ alt $+$ capt $$ blankline
176blockToRST (Para inlines)
176blockToRST (Para inlines)
177− | LineBreak `elem` inlines = do -- use line block if LineBreaks
177+ | LineBreak `elem` inlines = do -- use line block if LineBreaks
178 lns <- mapM inlineListToRST $ splitBy (==LineBreak) inlines
178 lns <- mapM inlineListToRST $ splitBy (==LineBreak) inlines
179 return $ (vcat $ map (text "| " <>) lns) <> blankline
179 return $ (vcat $ map (text "| " <>) lns) <> blankline
180 | otherwise = do
180 | otherwise = do