aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorPaul Rivier <paul.r.ml@gmail.com>2010-10-04 20:34:57 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-03 23:10:51 -0800
commit593b4f6c948f2b32c6fef170a37d725285c8e9c4 (patch)
treea5601b96dc4dbb71f07e8ad015a4cf4955f177f5 /src/Text/Pandoc
parenta7da0672dc9bc9e362f62a4de5ab14bffd0e86bc (diff)
downloadpandoc-593b4f6c948f2b32c6fef170a37d725285c8e9c4.tar.gz
fix autolink by promoting it in the parser list, fix table parabreak
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 5e4609c01..463ba14be 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -190,7 +190,6 @@ tableRow :: GenParser Char ParserState [TableCell]
tableRow = try $ do
char '|'
cells <- endBy1 tableCell (char '|')
- -- TODO : don't eat the last newline
newline
return cells
@@ -215,6 +214,7 @@ table :: GenParser Char ParserState Block
table = try $ do
headers <- option [] tableHeaders
rows <- tableRows
+ blanklines
let nbOfCols = max (length headers) (length $ head rows)
return $ Table []
(replicate nbOfCols AlignDefault)
@@ -239,7 +239,8 @@ inlines = manyTill inline newline
-- | Inline parsers tried in order
inlineParsers :: [GenParser Char ParserState Inline]
-inlineParsers = [ str
+inlineParsers = [ autoLink
+ , str
, whitespace
, endline
, code
@@ -253,8 +254,6 @@ inlineParsers = [ str
, simpleInline (char '^') Superscript
, simpleInline (char '~') Subscript
, link
- , autoLink
- , image
, image
, symbol
]
@@ -284,9 +283,10 @@ link = try $ do
-- | Detect plain links to http or email.
autoLink :: GenParser Char ParserState Inline
autoLink = do
- (orig, src) <- uri -- (try uri <|> try emailAddress)
+ (orig, src) <- (try uri <|> try emailAddress)
return $ Link [Str orig] (src, "")
+
-- | image embedding
image :: GenParser Char ParserState Inline
image = try $ do
@@ -326,7 +326,5 @@ simpleInline border construct = surrounded border inline >>=
--
-- - Pandoc Meta Information (title, author, date)
-- - footnotes
--- - autolink is not called
-- - should autolink be shared through Parsing.hs ?
-- - Inserted inline handling in writers
--- - table parser is a bit too greedy and require a double newline after tables \ No newline at end of file