git.iko.soy/typeable/pandoc
on master help sign in
Fixe autolinks with following punctuation.
2b08e32John MacFarlane
src/Text/Pandoc/Parsing.hs+1−1
@@ -452,7 +452,7 @@ uri = try $ do
452 let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit)
452 let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit)
453 let entity = () <$ characterReference
453 let entity = () <$ characterReference
454 let punct = skipMany1 (char ',')
454 let punct = skipMany1 (char ',')
455− <|> () <$ (satisfy (\c -> not (isSpace c) && c /= '<'))
455+ <|> () <$ (satisfy (\c -> not (isSpace c) && c /= '<' && c /= '>'))
456 let uriChunk = skipMany1 wordChar
456 let uriChunk = skipMany1 wordChar
457 <|> percentEscaped
457 <|> percentEscaped
458 <|> entity
458 <|> entity
tests/Tests/Readers/Markdown.hs+5
@@ -187,6 +187,11 @@ tests = [ testGroup "inline code"
187 ]
187 ]
188 , testGroup "bare URIs"
188 , testGroup "bare URIs"
189 (map testBareLink bareLinkTests)
189 (map testBareLink bareLinkTests)
190+ , testGroup "autolinks"
191+ [ "with unicode dash following" =:
192+ "<http://foo.bar>\8212" =?> para (autolink "http://foo.bar" <>
193+ str "\8212")
194+ ]
190 , testGroup "Headers"
195 , testGroup "Headers"
191 [ "blank line before header" =:
196 [ "blank line before header" =:
192 "\n# Header\n"
197 "\n# Header\n"