diff --git a/parsetools.py b/parsetools.py index cc16d6b..4c17e18 100644 --- a/parsetools.py +++ b/parsetools.py @@ -21,6 +21,7 @@ _mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)") oocre = re.compile(r"[\[(][\[(].*[\])][\])]") _format_begin = re.compile(r'(?i)<([ibu])>') _format_end = re.compile(r'(?i)') +_honk = re.compile(r"(?i)\bhonk\b") quirkloader = PythonQuirks() _functionre = re.compile(r"%s" % quirkloader.funcre()) @@ -173,6 +174,14 @@ class smiley(object): return "%s" % (smiledict[self.string], self.string, self.string) else: return self.string +class honker(object): + def __init__(self, string): + self.string = string + def convert(self, format): + if format == "html": + return "" + else: + return self.string class mecmd(object): def __init__(self, string, mecmd, suffix): self.string = string @@ -189,7 +198,8 @@ def lexMessage(string): (hyperlink, _urlre), (hyperlink_lazy, _url2re), (memolex, _memore), (chumhandlelex, _handlere), - (smiley, _smilere)] + (smiley, _smilere), + (honker, _honk)] string = unicode(string) string = string.replace("\n", " ").replace("\r", " ") diff --git a/smilies/honk.png b/smilies/honk.png new file mode 100644 index 0000000..e22e8ca Binary files /dev/null and b/smilies/honk.png differ