From e3f54bfe72a742afbe81e363bacc1869959f50c9 Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Mon, 17 Dec 2007 10:51:28 +0100 Subject: [PATCH] Switch to creole syntax for --- geekigeeki.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index 83b6142..7193d55 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -336,7 +336,7 @@ class PageFormatter: def __init__(self, raw): self.raw = raw self.h_level = 0 - self.in_pre = self.in_table = self.in_var = self.in_em = self.in_b = False + self.in_pre = self.in_table = self.in_tt = self.in_em = self.in_b = False self.in_header = True self.list_indents = [] self.tr_cnt = self.h_cnt = 0 @@ -349,6 +349,10 @@ class PageFormatter: self.in_em = not self.in_em return ['', ''][self.in_em] + def _tt_repl(self, word): + self.in_tt = not self.in_tt + return ['', ''][self.in_tt] + def _tit_repl(self, word): if self.h_level: result = '' % self.h_level @@ -432,15 +436,6 @@ class PageFormatter: cl = 'notice' return '' + word + '' - def _var_repl(self, word): - if word == '{{' and not self.in_var: - self.in_var = True - return '' - elif self.in_var: - self.in_var = False - return '' - return '' - def _tr_repl(self, word): out = '' if not self.in_table: @@ -502,6 +497,7 @@ class PageFormatter: # Formatting + r"(?P\*\*|''')" + r"|(?P//|'')" + + r"|(?P##|``)" + r"|(?P\={2,6})" + r"|(?P
\\\\)" + r"|(?P^-{3,})" @@ -519,7 +515,6 @@ class PageFormatter: # Lists, divs, spans + r"|(?P
  • ^\s+[\*#] +)" + r"|(?P
    \{\{\{|\s*\}\}\})"
    -            + r"|(?P\{\{|\}\})"
     
                 # Tables
                 + r"|(?P^\s*\|\|(=|)\s*)"
    -- 
    2.25.1