git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: Fixed bug (swallowed p at beginning of paragraph).

The problem was a missing 'try' in the maybeExplicitBlock parser. Test case, a paragraph beginning with 'p', has been added.

commit628a1ef81548ccf0307276b4f9164191cacc9193 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 23 Jan 2011, 08:59 (16 years ago) parent7234a79
3 files changed+6−3
src/Text/Pandoc/Readers/Textile.hs+3−3 tests/textile-reader.native+1 tests/textile-reader.textile+2
src/Text/Pandoc/Readers/Textile.hs+3−3
@@ -340,10 +340,10 @@ table = try $ do
340340-- | Blocks like 'p' and 'table' do not need explicit block tag.
341341-- However, they can be used to set HTML/CSS attributes when needed.
342342maybeExplicitBlock :: String -- ^ block tag name
343− -> GenParser Char ParserState Block -- ^ implicit block
344− -> GenParser Char ParserState Block
343+ -> GenParser Char ParserState Block -- ^ implicit block
344+ -> GenParser Char ParserState Block
345345maybeExplicitBlock name blk = try $ do
346− optional $ string name >> optional attributes >> char '.' >>
346+ optional $ try $ string name >> optional attributes >> char '.' >>
347347 ((try whitespace) <|> endline)
348348 blk
349349
tests/textile-reader.native+1
@@ -15,6 +15,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
1515 [[Plain [Str "criminey",Str "."]]]
1616,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"]
1717,Para [Str "and",Space,Str "here",Str "."]
18+,Para [Str "pandoc",Space,Str "converts",Space,Str "textile",Str "."]
1819,Header 1 [Str "Block",Space,Str "Quotes"]
1920,BlockQuote
2021 [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "famous",Space,Str "quote",Space,Str "from",Space,Str "somebody",Str ".",Space,Str "He",Space,Str "had",Space,Str "a",Space,Str "lot",Space,Str "of",Space,Str "things",Space,Str "to",LineBreak,Str "say",Str ",",Space,Str "so",Space,Str "the",Space,Str "text",Space,Str "is",Space,Str "really",Space,Str "really",Space,Str "long",Space,Str "and",Space,Str "spans",Space,Str "on",Space,Str "multiple",Space,Str "lines",Str "."]]
tests/textile-reader.textile+2
@@ -33,6 +33,8 @@ There should be a paragraph break between here
3333
3434and here.
3535
36+pandoc converts textile.
37+
3638h1. Block Quotes
3739
3840bq. This is a famous quote from somebody. He had a lot of things to