Ticket #2916: wikifmt.patch
| File wikifmt.patch, 1.5 KB (added by eblot, 6 years ago) |
|---|
-
trac/wiki/formatter.py
586 586 else: 587 587 self.code_text += line + os.linesep 588 588 elif not self.code_processor: 589 match = Formatter._processor_re.search(line) 590 if match: 591 name = match.group(1) 592 self.code_processor = WikiProcessor(self.env, name) 593 else: 594 self.code_text += line + os.linesep 595 self.code_processor = WikiProcessor(self.env, 'default') 589 (self.code_processor, self.code_text) = self._find_code_processor(line) 596 590 else: 597 591 self.code_text += line + os.linesep 598 592 593 def _find_code_processor(self, line): 594 match = Formatter._processor_re.search(line) 595 if match: 596 name = match.group(1) 597 return (WikiProcessor(self.env, name), '') 598 else: 599 return (WikiProcessor(self.env, 'default'), line + os.linesep) 600 599 601 def format(self, text, out, escape_newlines=False): 600 602 self.out = out 601 603 self._open_tags = [] … … 743 745 def _macro_formatter(self, match, fullmatch): 744 746 return match 745 747 748 def _find_code_processor(self, line): 749 return (WikiProcessor(self.env, 'default'), '') 750 746 751 def format(self, text, out, max_depth=6, min_depth=1): 747 752 self.outline = [] 748 753 class NullOut(object):
