From f49e60a8b87ef28bcaeeeae00f6e330c6155851b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 30 Dec 2010 14:33:11 -0800 Subject: Textile reader: Slight speed improvement. --- src/Text/Pandoc/Readers/Textile.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 8362c542c..c3b2e69a2 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -356,14 +356,13 @@ inlines = manyTill inline newline -- | Inline parsers tried in order inlineParsers :: [GenParser Char ParserState Inline] inlineParsers = [ autoLink - , mark - , note , str - , htmlSpan , whitespace , endline + , htmlSpan , rawHtmlInline , code + , note , simpleInline (string "??") (Cite []) , simpleInline (string "**") Strong , simpleInline (string "__") Emph @@ -374,6 +373,7 @@ inlineParsers = [ autoLink , simpleInline (char '~') Subscript , link , image + , mark , smartPunctuation inline , symbol ] @@ -450,14 +450,14 @@ endline = try $ do rawHtmlInline :: GenParser Char ParserState Inline rawHtmlInline = liftM (HtmlInline . snd) $ htmlTag isInlineTag --- | Textile standard link syntax is label:"target" +-- | Textile standard link syntax is "label":target link :: GenParser Char ParserState Inline link = try $ do name <- surrounded (char '"') inline char ':' url <- manyTill (anyChar) (lookAhead $ (space <|> try (oneOf ".;," >> (space <|> newline)))) return $ Link name (url, "") - + -- | Detect plain links to http or email. autoLink :: GenParser Char ParserState Inline autoLink = do -- cgit v1.2.3