diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-04-05 20:31:27 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-04-05 20:31:27 -0700 |
commit | 75dbe87a9969d3fb684409f26bb14b593ea68ca7 (patch) | |
tree | a0f5420563c60f647459026b551a677731ed4e42 /src/Text | |
parent | d4054444c00449f49a8948eae91ad7bfdb36ea8e (diff) | |
download | pandoc-75dbe87a9969d3fb684409f26bb14b593ea68ca7.tar.gz |
Removed whitespace at ends of lines.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Textile.hs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index c6f992275..b42c5e75d 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -54,7 +54,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Builder (Inlines, Blocks, trimInlines) import qualified Text.Pandoc.Builder as B import Text.Pandoc.Options -import Text.Pandoc.Parsing +import Text.Pandoc.Parsing import Text.Pandoc.Readers.HTML ( htmlTag, isInlineTag, isBlockTag ) import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock ) import Text.HTML.TagSoup (parseTags, innerText, fromAttrib, Tag(..)) @@ -225,7 +225,7 @@ bulletListAtDepth depth = try $ B.bulletList <$> many1 (bulletListItemAtDepth d -- | Bullet List Item of given depth, depth being the number of -- leading '*' -bulletListItemAtDepth :: Int -> Parser [Char] ParserState Blocks +bulletListItemAtDepth :: Int -> Parser [Char] ParserState Blocks bulletListItemAtDepth = genericListItemAtDepth '*' -- | Ordered List of given depth, depth being the number of @@ -237,7 +237,7 @@ orderedListAtDepth depth = try $ do -- | Ordered List Item of given depth, depth being the number of -- leading '#' -orderedListItemAtDepth :: Int -> Parser [Char] ParserState Blocks +orderedListItemAtDepth :: Int -> Parser [Char] ParserState Blocks orderedListItemAtDepth = genericListItemAtDepth '#' -- | Common implementation of list items @@ -274,7 +274,7 @@ definitionListItem = try $ do where inlineDef :: Parser [Char] ParserState [Blocks] inlineDef = liftM (\d -> [B.plain d]) $ optional whitespace >> (trimInlines . mconcat <$> many listInline) <* newline - multilineDef :: Parser [Char] ParserState [Blocks] + multilineDef :: Parser [Char] ParserState [Blocks] multilineDef = try $ do optional whitespace >> newline s <- many1Till anyChar (try (string "=:" >> newline)) @@ -596,7 +596,7 @@ surrounded border = enclosed (border *> notFollowedBy (oneOf " \t\n\r")) (try bo simpleInline :: Parser [Char] ParserState t -- ^ surrounding parser -> (Inlines -> Inlines) -- ^ Inline constructor -> Parser [Char] ParserState Inlines -- ^ content parser (to be used repeatedly) -simpleInline border construct = groupedSimpleInline border construct <|> ungroupedSimpleInline border construct +simpleInline border construct = groupedSimpleInline border construct <|> ungroupedSimpleInline border construct ungroupedSimpleInline :: Parser [Char] ParserState t -- ^ surrounding parser -> (Inlines -> Inlines) -- ^ Inline constructor @@ -605,27 +605,27 @@ ungroupedSimpleInline border construct = try $ do st <- getState pos <- getPosition isWhitespace <- option False (whitespace >> return True) - guard $ (stateQuoteContext st /= NoQuote) - || (sourceColumn pos == 1) + guard $ (stateQuoteContext st /= NoQuote) + || (sourceColumn pos == 1) || isWhitespace body <- surrounded border inlineWithAttribute lookAhead (notFollowedBy alphaNum) - let result = construct $ mconcat body - return $ if isWhitespace then B.space <> result + let result = construct $ mconcat body + return $ if isWhitespace then B.space <> result else result - where - inlineWithAttribute = (try $ optional attributes) >> notFollowedBy (string "\n\n") + where + inlineWithAttribute = (try $ optional attributes) >> notFollowedBy (string "\n\n") >> (withQuoteContext InSingleQuote inline) -groupedSimpleInline :: Parser [Char] ParserState t +groupedSimpleInline :: Parser [Char] ParserState t -> (Inlines -> Inlines) - -> Parser [Char] ParserState Inlines + -> Parser [Char] ParserState Inlines groupedSimpleInline border construct = try $ do - char '[' + char '[' withQuoteContext InSingleQuote (simpleInline border construct) >>~ char ']' - + -- | Create a singleton list |