summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-23 08:59:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-23 08:59:35 -0800
commit628a1ef81548ccf0307276b4f9164191cacc9193 (patch)
tree47d1e3a37bdd6d9555b2988f8e273d6fbc94fa6e
parent7234a79104ab8cf8358bdab153d5eefbcefc2e9a (diff)
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.
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs6
-rw-r--r--tests/textile-reader.native1
-rw-r--r--tests/textile-reader.textile2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index f9007d77c..4221754cc 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -340,10 +340,10 @@ table = try $ do
-- | Blocks like 'p' and 'table' do not need explicit block tag.
-- However, they can be used to set HTML/CSS attributes when needed.
maybeExplicitBlock :: String -- ^ block tag name
- -> GenParser Char ParserState Block -- ^ implicit block
- -> GenParser Char ParserState Block
+ -> GenParser Char ParserState Block -- ^ implicit block
+ -> GenParser Char ParserState Block
maybeExplicitBlock name blk = try $ do
- optional $ string name >> optional attributes >> char '.' >>
+ optional $ try $ string name >> optional attributes >> char '.' >>
((try whitespace) <|> endline)
blk
diff --git a/tests/textile-reader.native b/tests/textile-reader.native
index 9c971c105..d0079cd19 100644
--- a/tests/textile-reader.native
+++ b/tests/textile-reader.native
@@ -15,6 +15,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
[[Plain [Str "criminey",Str "."]]]
,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"]
,Para [Str "and",Space,Str "here",Str "."]
+,Para [Str "pandoc",Space,Str "converts",Space,Str "textile",Str "."]
,Header 1 [Str "Block",Space,Str "Quotes"]
,BlockQuote
[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 "."]]
diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile
index 4ae47ea20..9c9980307 100644
--- a/tests/textile-reader.textile
+++ b/tests/textile-reader.textile
@@ -33,6 +33,8 @@ There should be a paragraph break between here
and here.
+pandoc converts textile.
+
h1. Block Quotes
bq. This is a famous quote from somebody. He had a lot of things to