From 498bee2e20ac3a4aebd85a22b751a042320d8ff7 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 30 Aug 2019 10:37:13 -0400 Subject: [PATCH] Improve image path matching regex for html_filter --- src/python/html_filter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/html_filter.py b/src/python/html_filter.py index 53933073..1c48410f 100644 --- a/src/python/html_filter.py +++ b/src/python/html_filter.py @@ -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, ))