git.iko.soy/typeable/pandoc
on master help sign in
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.

commit099b4b776985e23bffb06b3dca3a697d3fde2a41 authorJohn MacFarlane <fiddlosopher@gmail.com> dateThu 28 Mar 2013, 09:54 (14 years ago) parent351b3e0
3 files changed+4−2
src/Text/Pandoc/Parsing.hs+1−1 tests/mediawiki-reader.native+2−1 tests/mediawiki-reader.wiki+1
src/Text/Pandoc/Parsing.hs+1−1
@@ -430,7 +430,7 @@ uri = try $ do
430430 let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit)
431431 let entity = () <$ characterReference
432432 let punct = skipMany1 (char ',')
433− <|> () <$ (satisfy (not . isSpace))
433+ <|> () <$ (satisfy (\c -> not (isSpace c) && c /= '<'))
434434 let uriChunk = skipMany1 wordChar
435435 <|> percentEscaped
436436 <|> entity
tests/mediawiki-reader.native+2−1
@@ -242,4 +242,5 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
242242 [[[Para [Str "Orange"]]]]
243243,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."]
244244,Header 2 ("",[],[]) [Str "notes"]
245−,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]]
245+,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]
246+,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","")]]]]
tests/mediawiki-reader.wiki+1
@@ -370,3 +370,4 @@ and cheese
370370
371371My note!<ref>This.</ref>
372372
373+URL note.<ref>http://docs.python.org/library/functions.html#range</ref>