git.iko.soy/typeable/pandoc
on master help sign in
Move anyLineNewline to Parsing.hs
commit55ce47d050fd6e1a38db765c7632e1989d60854d authorAlexander Krotov <ilabdsf@gmail.com> dateWed 17 May 2017, 01:52 (9 years ago) parentfbce422
5 files changed+7−8
src/Text/Pandoc/Parsing.hs+5 src/Text/Pandoc/Readers/Markdown.hs+1−1 src/Text/Pandoc/Readers/Org/Blocks.hs−4 src/Text/Pandoc/Readers/Org/Parsing.hs+1 src/Text/Pandoc/Readers/Txt2Tags.hs−3
src/Text/Pandoc/Parsing.hs+5
@@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3636A utility library with parsers used in pandoc readers.
3737-}
3838module Text.Pandoc.Parsing ( anyLine,
39+ anyLineNewline,
3940 many1Till,
4041 notFollowedBy',
4142 oneOfStrings,
@@ -253,6 +254,10 @@ anyLine = do
253254 return this
254255 _ -> mzero
255256
257+-- | Parse any line, include the final newline in the output
258+anyLineNewline :: Stream [Char] m Char => ParserT [Char] st m [Char]
259+anyLineNewline = (++ "\n") <$> anyLine
260+
256261-- | Like @manyTill@, but reads at least one item.
257262many1Till :: Stream s m t
258263 => ParserT s st m a
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -614,7 +614,7 @@ hrule = try $ do
614614--
615615
616616indentedLine :: PandocMonad m => MarkdownParser m String
617−indentedLine = indentSpaces >> anyLine >>= return . (++ "\n")
617+indentedLine = indentSpaces >> anyLineNewline
618618
619619blockDelimiter :: PandocMonad m
620620 => (Char -> Bool)
src/Text/Pandoc/Readers/Org/Blocks.hs−4
@@ -1017,7 +1017,3 @@ listContinuation markerLength = try $
10171017 then count num (char ' ')
10181018 else choice [ try (count num (char ' '))
10191019 , try (char '\t' >> count (num - tabStop) (char ' ')) ]
1020−
1021−-- | Parse any line, include the final newline in the output.
1022−anyLineNewline :: Monad m => OrgParser m String
1023−anyLineNewline = (++ "\n") <$> anyLine
src/Text/Pandoc/Readers/Org/Parsing.hs+1
@@ -31,6 +31,7 @@ functions are adapted to Org-mode specific functionality.
3131module Text.Pandoc.Readers.Org.Parsing
3232 ( OrgParser
3333 , anyLine
34+ , anyLineNewline
3435 , blanklines
3536 , newline
3637 , parseFromString
src/Text/Pandoc/Readers/Txt2Tags.hs−3
@@ -277,9 +277,6 @@ listContinuation markerLength = try $
277277 <*> many blankline)
278278 where listLine = try $ indentWith markerLength *> anyLineNewline
279279
280−anyLineNewline :: T2T String
281−anyLineNewline = (++ "\n") <$> anyLine
282−
283280indentWith :: Int -> T2T String
284281indentWith n = count n space
285282