Browse Source

Absolute URL for emoticons

pull/2/head
Noah Petherbridge 5 years ago
parent
commit
364c334b98
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      rophako/model/emoticons.py

+ 2
- 1
rophako/model/emoticons.py View File

@@ -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))


Loading…
Cancel
Save