Improve image path matching regex for html_filter

This commit is contained in:
miruka 2019-08-30 10:37:13 -04:00
parent 06d75a18fc
commit 498bee2e20

View File

@ -191,7 +191,9 @@ class HtmlFilter:
@staticmethod
def _is_image_path(link: str) -> bool:
return bool(re.match(
r".+\.(jpg|jpeg|png|gif|bmp|webp|tiff|svg)$", link, re.IGNORECASE,
r"(https?|s?ftp)://.+/.+\.(jpg|jpeg|png|gif|bmp|webp|tiff|svg)$",
link,
re.IGNORECASE,
))