Skip to content

Commit

Permalink
fix(linker): make https optional in WebPage.normalize_url so that the…
Browse files Browse the repository at this point in the history
… function is more reusable
  • Loading branch information
nsantacruz committed Jan 28, 2024
1 parent b07d4f5 commit dd32508
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sefaria/model/webpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def normalize_url(url):
"remove url params": lambda url: re.sub(r"\?.+", "", url),
"remove utm params": lambda url: re.sub(r"\?utm_.+", "", url),
"remove fbclid param": lambda url: re.sub(r"\?fbclid=.+", "", url),
"remove www": lambda url: re.sub(r"^(https?://)www\.", r"\1", url),
"remove www": lambda url: re.sub(r"^(https?://)?www\.", r"\1", url),
"remove mediawiki params": lambda url: re.sub(r"&.+", "", url),
"remove sort param": lambda url: re.sub(r"\?sort=.+", "", url),
"remove all params after id": lambda url: re.sub(r"(\?id=\d+).+$", r"\1", url)
Expand Down

0 comments on commit dd32508

Please sign in to comment.