git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #273 from qerub/master

Textile reader: Make it possible to have colons after links.

commitb30afc2009bf22d49ceaadf1b7b94c298386c89a authorJohn MacFarlane <jgm@berkeley.edu> dateMon 11 Jul 2011, 08:31 (15 years ago) parentc83b5788fa4e8b
3 files changed+4−1
src/Text/Pandoc/Readers/Textile.hs+1−1 tests/textile-reader.native+1 tests/textile-reader.textile+2
src/Text/Pandoc/Readers/Textile.hs+1−1
@@ -465,7 +465,7 @@ link :: GenParser Char ParserState Inline
465465link = try $ do
466466 name <- surrounded (char '"') inline
467467 char ':'
468− url <- manyTill (anyChar) (lookAhead $ (space <|> try (oneOf ".;," >> (space <|> newline))))
468+ url <- manyTill (anyChar) (lookAhead $ (space <|> try (oneOf ".;,:" >> (space <|> newline))))
469469 return $ Link name (url, "")
470470
471471-- | Detect plain links to http or email.
tests/textile-reader.native+1
@@ -78,6 +78,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
7878,Para [Str "Just",Space,Str "a",Space,Link [Str "url"] ("http://www.url.com","")]
7979,Para [Link [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")]
8080,Para [Str "Automatic",Space,Str "linking",Space,Str "to",Space,Link [Str "http://www.example.com"] ("http://www.example.com",""),Space,Str "and",Space,Link [Str "foobar@example.com"] ("mailto:foobar@example.com",""),Str "."]
81+,Para [Link [Str "Example"] ("http://www.example.com/",""),Str ":",Space,Str "Example",Space,Str "of",Space,Str "a",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "colon",Str "."]
8182,Header 1 [Str "Tables"]
8283,Para [Str "Textile",Space,Str "allows",Space,Str "tables",Space,Str "with",Space,Str "and",Space,Str "without",Space,Str "headers",Space,Str ":"]
8384,Header 2 [Str "Without",Space,Str "headers"]
tests/textile-reader.textile+2
@@ -141,6 +141,8 @@ Just a "url":http://www.url.com
141141
142142Automatic linking to http://www.example.com and foobar@example.com.
143143
144+"Example":http://www.example.com/: Example of a link followed by a colon.
145+
144146h1. Tables
145147
146148Textile allows tables with and without headers :