Extraction: Fix url prefixing

This commit is contained in:
James Taylor
2019-09-08 17:20:02 -07:00
parent 1b6fb4e100
commit fb1a3531c5
3 changed files with 19 additions and 8 deletions

View File

@@ -317,3 +317,7 @@ def uppercase_escape(s):
return re.sub(
r'\\U([0-9a-fA-F]{8})',
lambda m: chr(int(m.group(1), base=16)), s)
def prefix_url(url):
url = url.lstrip('/') # some urls have // before them, which has a special meaning
return '/' + url