diff --git a/text_dokuwiki.py b/text_dokuwiki.py index c0bee7c..856580d 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -1,9 +1,9 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- """ MoinMoin - Dokuwiki Formatter - @copyright: 2000, 2001, 2002 by Jürgen Hermann - @copyright: 2011-2012 Elan Ruusamäe + @copyright: 2000, 2001, 2002 by Jürgen Hermann + @copyright: 2011-2012 Elan Ruusamäe @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