aboutsummaryrefslogtreecommitdiff
path: root/textoutpc/builtin/_Image.py
diff options
context:
space:
mode:
authorThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2018-07-30 14:03:40 +0200
committerThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2018-07-30 14:03:40 +0200
commitd061fabfd813e6b38deb5fd5a91e7b992c3b7b2a (patch)
tree3fbbe62f674d2d45e0c94e58db991a0684adc9f6 /textoutpc/builtin/_Image.py
parent8459e04f29dfd2ccd6c68f7744bbb66cfc007a9d (diff)
Added a few tags.
Diffstat (limited to 'textoutpc/builtin/_Image.py')
-rwxr-xr-xtextoutpc/builtin/_Image.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/textoutpc/builtin/_Image.py b/textoutpc/builtin/_Image.py
index a9166a7..6f9eb32 100755
--- a/textoutpc/builtin/_Image.py
+++ b/textoutpc/builtin/_Image.py
@@ -60,14 +60,16 @@ class ImageTag(_BlockTag):
if fl:
self._float = True
- def preprocess(self, content):
+ def _checkurl(self):
for prefix in ('http://', 'https://', 'ftp://', '/'):
- if content.startswith(prefix):
+ if self._url.startswith(prefix):
break
else:
raise Exception("No allowed prefix!")
+ def preprocess(self, content):
self._url = content
+ self._checkurl()
def content_html(self):
style = []
@@ -109,8 +111,7 @@ class AdminImageTag(ImageTag):
aliases = ('[adimg]',)
def preprocess(self, content):
- path = content
- # FIXME: check image URL!
- self._url = 'https://www.planet-casio.com/images/ad/' + path
+ self._url = 'https://www.planet-casio.com/images/ad/' + content
+ self._checkurl()
# End of file.