X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=geekigeeki.py;h=081517a64853ee460f3346b59ff04b201d706c8a;hb=cd485ccea608860b133c50432d5ffb51aaf0eb8b;hp=4450aead0d3617848117f6c7ad6098a758b8877d;hpb=042882ca5918a6f84a176e4ef9dc19428ac4566f;p=geekigeeki.git diff --git a/geekigeeki.py b/geekigeeki.py index 4450aea..081517a 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -151,11 +151,11 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal # Navbar print '' @@ -321,14 +321,14 @@ class WikiFormatter: self.styles = { #wiki html enabled? "//": ["em", False], - "''": ["em", False], "**": ["b", False], - "'''": ["b", False], "##": ["tt", False], - "``": ["tt", False], "__": ["u", False], "^^": ["sup", False], - ",,": ["sub", False] + ",,": ["sub", False], + "''": ["em", False], # LEGACY + "'''": ["b", False], # LEGACY + "``": ["tt", False], # LEGACY } def _b_repl(self, word): @@ -379,12 +379,6 @@ class WikiFormatter: m = link_re.match(word) return link_tag(m.group(1), m.group(2)) - def _url_repl(self, word): - return link_tag(word) - - def _word_repl(self, word): - return link_tag(word) - def _inl_repl(self, word): m = link_re.match(word) name = relative_url(m.group(1)) @@ -405,12 +399,6 @@ class WikiFormatter: else: return '' % (name, name) - def _img_repl(self, word): - return self._inl_repl('{{' + word + '}}') - - def _email_repl(self, word): - return '%s' % (word, word) - def _html_repl(self, word): self.in_html += 1 return word; # Pass through @@ -426,6 +414,21 @@ class WikiFormatter: '<': '<', '>': '>'}[s] + def _img_repl(self, word): # LEGACY + return self._inl_repl('{{' + word + '}}') + + def _word_repl(self, word): # LEGACY + if self.in_html: return word # pass through + return link_tag(word) + + def _url_repl(self, word): # LEGACY + if self.in_html: return word # pass through + return link_tag(word) + + def _email_repl(self, word): # LEGACY + if self.in_html: return word # pass through + return '%s' % (word, word) + def _li_repl(self, match): if self.in_li: return '
  • '