Selaa lähdekoodia

Absolute URL for emoticons

pull/2/head
Noah Petherbridge 7 vuotta sitten
vanhempi
commit
364c334b98
  1. 3
      rophako/model/emoticons.py

3
rophako/model/emoticons.py

@ -2,6 +2,7 @@
"""Emoticon models."""
from flask import request
import os
import codecs
import json
@ -69,7 +70,7 @@ def render(message):
if trigger in message:
# Substitute it.
sub = """<img src="{url}" class="rophako-emoticon" alt="{trigger}" title="{trigger}">""".format(
url="/static/smileys/{}/{}".format(Config.emoticons.theme, img),
url="{}/static/smileys/{}/{}".format(request.url_root.strip("/"), Config.emoticons.theme, img),
trigger=trigger,
)
pattern = r'([^A-Za-z0-9:\-]|^){}([^A-Za-z0-9:\-]|$)'.format(re.escape(trigger))

Ladataan…
Peruuta
Tallenna