thumbnails: Add setting THUMBNAIL_IMAGES.

This setting splits away part of responsibility from THUMBOR_URL.
Now on, this setting will be responsible for controlling whether
we thumbnail images or not by asking bugdown to render image links
to hit our /thumbnail endpoint. This is irrespective of what
THUMBOR_URL is set to though ideally THUMBOR_URL should be set
to point to a running thumbor instance.
This commit is contained in:
Aditya Bansal
2019-01-04 20:52:04 +05:30
committed by Tim Abbott
parent 9e9bd2456f
commit 3ee69f3da9
7 changed files with 14 additions and 6 deletions

View File

@@ -379,7 +379,7 @@ class BugdownTest(ZulipTestCase):
msg = 'https://www.google.com/images/srpr/logo4w.png'
thumbnail_img = '<div class="message_inline_image"><a href="https://www.google.com/images/srpr/logo4w.png" target="_blank" title="https://www.google.com/images/srpr/logo4w.png"><img src="https://www.google.com/images/srpr/logo4w.png"></a></div>'
with self.settings(THUMBOR_URL=''):
with self.settings(THUMBNAIL_IMAGES=False):
converted = bugdown_convert(msg)
self.assertIn(thumbnail_img, converted)