From 6cb357e76c5e5ce0c42a1e3718ed28f8f604e6cc Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 24 Apr 2024 19:41:11 -0700 Subject: [PATCH] fix fix_url_from_markdown assertion to be valid url --- archivebox/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/util.py b/archivebox/util.py index e7de03b4..b5cfebb4 100644 --- a/archivebox/util.py +++ b/archivebox/util.py @@ -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 = [