convert few simleys

This commit is contained in:
Elan Ruusamäe 2012-09-17 11:10:46 +02:00
parent c9b5272239
commit ab349e1576

View file

@ -1,9 +1,9 @@
# -*- coding: iso-8859-1 -*-
# -*- coding: utf-8 -*-
"""
MoinMoin - Dokuwiki Formatter
@copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de>
@copyright: 2011-2012 Elan Ruusamäe <glen@delfi.ee>
@copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de>
@copyright: 2011-2012 Elan Ruusamäe <glen@delfi.ee>
@license: GNU GPL, see COPYING for details.
"""
@ -287,3 +287,24 @@ class Formatter(FormatterBase):
else:
text = lookup
return text
def smiley(self, text):
try:
# https://www.dokuwiki.org/devel:smileys.conf
return {
# note: reverse sorted
'(./)' : u'',
':o' : ':-o',
':D' : ':-D',
'B)' : ':-D',
'B-)' : ':-D',
'|)' : '|-)',
':\\' : ':-\\',
':))' : ':-)',
':)' : ':-)',
':(' : ':-(',
':-))' : ':-)',
';)' : ';-)',
}[text]
except KeyError:
return text