Pārlūkot izejas kodu

Absolute URL for emoticons

pull/2/head
Noah Petherbridge pirms 6 gadiem
vecāks
revīzija
364c334b98
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. +2
    -1
      rophako/model/emoticons.py

+ 2
- 1
rophako/model/emoticons.py Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt