1
0
Fork 0
mirror of synced 2024-05-16 18:32:41 +12:00

fix fix_url_from_markdown assertion to be valid url

This commit is contained in:
Nick Sweeting 2024-04-24 19:41:11 -07:00
parent 128419f991
commit 6cb357e76c
No known key found for this signature in database

View file

@ -451,7 +451,7 @@ class ExtendedEncoder(pyjson.JSONEncoder):
# the consequences of bad URL parsing could be disastrous and lead to many
# incorrect/badly parsed links being added to the archive, so this is worth the cost of checking
assert fix_url_from_markdown('/a(b)c).x(y)z') == '/a(b)c'
assert fix_url_from_markdown('http://example.com/a(b)c).x(y)z') == 'http://example.com/a(b)c'
assert fix_url_from_markdown('https://wikipedia.org/en/some_article_(Disambiguation).html?abc=def).link(with)_trailingtext') == 'https://wikipedia.org/en/some_article_(Disambiguation).html?abc=def'
URL_REGEX_TESTS = [