Mediawiki: Fixed regression for <ref>URL</ref>.

`<` is no longer allowed in URLs, according to the uri parser
in Text.Pandoc.Parsing.

Added a test case.
This commit is contained in:
John MacFarlane 2013-03-28 09:54:02 -07:00
parent 351b3e09c3
commit 099b4b7769
3 changed files with 4 additions and 2 deletions

View file

@ -430,7 +430,7 @@ uri = try $ do
let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit)
let entity = () <$ characterReference
let punct = skipMany1 (char ',')
<|> () <$ (satisfy (not . isSpace))
<|> () <$ (satisfy (\c -> not (isSpace c) && c /= '<'))
let uriChunk = skipMany1 wordChar
<|> percentEscaped
<|> entity

View file

@ -242,4 +242,5 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
[[[Para [Str "Orange"]]]]
,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."]
,Header 2 ("",[],[]) [Str "notes"]
,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]]
,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]
,Para [Str "URL",Space,Str "note.",Note [Plain [Link [Str "http://docs.python.org/library/functions.html#range"] ("http://docs.python.org/library/functions.html#range","")]]]]

View file

@ -370,3 +370,4 @@ and cheese
My note!<ref>This.</ref>
URL note.<ref>http://docs.python.org/library/functions.html#range</ref>