From 059fa25edfc5448c84a9ece193f4c53ada411380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 6 Aug 2018 23:55:07 +0200 Subject: [PATCH] [preview] Fix faulty conversion of text to url --- url_image_preview/url_image_preview.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/url_image_preview/url_image_preview.py b/url_image_preview/url_image_preview.py index 45c3dae..cdf697a 100644 --- a/url_image_preview/url_image_preview.py +++ b/url_image_preview/url_image_preview.py @@ -168,6 +168,11 @@ class Base(object): def print_real_text(self, real_text, text_tags, graphics, iter_, additional_data): + if len(real_text.split(' ')) > 1: + # urlparse dont recognises spaces as URL delimiter + log.error('Url with text will not be displayed: %s', real_text) + return + urlparts = urlparse(real_text) if not self._accept_uri(urlparts, real_text, additional_data): return