Ticket #2657: div_macro_fix.diff
| File div_macro_fix.diff, 1.5 kB (added by cboos, 3 years ago) |
|---|
-
formatter.py
107 107 self.error) 108 108 text = self.processor(req, text) 109 109 if inline: 110 code_block_start = re.compile('^<div class="code-block">')110 code_block_start = re.compile('^<div(?:\s+class="([^"]+)")?>') 111 111 code_block_end = re.compile('</div>$') 112 text, nr = code_block_start.subn('<span class="code-block">', text, 1 ) 113 if nr: 114 text, nr = code_block_end.subn('</span>', text, 1 ) 112 match = re.match(code_block_start, text) 113 if match: 114 if match.group(1) and 'code' in match.group(1): 115 text, nr = code_block_start.subn('<span class="code-block">', text, 1 ) 116 if nr: 117 text, nr = code_block_end.subn('</span>', text, 1 ) 118 else: 119 text = "</p>%s<p>" % text 115 120 return text 116 121 else: 117 122 return text … … 405 410 args = fullmatch.group('macroargs') 406 411 try: 407 412 macro = WikiProcessor(self.env, name) 408 return macro.process(self.req, args, 1)413 return macro.process(self.req, args, True) 409 414 except Exception, e: 410 415 self.env.log.error('Macro %s(%s) failed' % (name, args), 411 416 exc_info=True)
