From bc0dbbb5669896e58024d8d0a53daa7527cbfc87 Mon Sep 17 00:00:00 2001 From: Reid Barton Date: Tue, 5 Mar 2013 18:03:45 -0500 Subject: [PATCH] Detect image-ness by end of path component, not end of entire URL (imported from commit 9dd2e9c7273d3c7d071a8e5f82014e28b2a99ee4) --- zephyr/lib/bugdown/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zephyr/lib/bugdown/__init__.py b/zephyr/lib/bugdown/__init__.py index ca8c0ca4d7..30584b27e7 100644 --- a/zephyr/lib/bugdown/__init__.py +++ b/zephyr/lib/bugdown/__init__.py @@ -15,9 +15,10 @@ from zephyr.lib.timeout import timeout class InlineImagePreviewProcessor(markdown.treeprocessors.Treeprocessor): def is_image(self, url): + parsed_url = urlparse.urlparse(url) # List from http://support.google.com/chromeos/bin/answer.py?hl=en&answer=183093 for ext in [".bmp", ".gif", ".jpg", "jpeg", ".png", ".webp"]: - if url.lower().endswith(ext): + if parsed_url.path.lower().endswith(ext): return True return False