Ticket #5647: ticket-5647-r7601.patch
| File ticket-5647-r7601.patch, 1.2 KB (added by ebray, 4 years ago) |
|---|
-
trac/wiki/formatter.py
61 61 class WikiProcessor(object): 62 62 63 63 _code_block_re = re.compile('^<div(?:\s+class="([^"]+)")?>(.*)</div>$') 64 _block_elem_re = re.compile(r'^\s*<(?:div|table)(?:\s+[^>]+)?>', 65 re.I | re.M) 64 66 65 67 def __init__(self, formatter, name, args={}): 66 68 """Find the processor by name … … 206 208 interrupt_paragraph = True 207 209 else: 208 210 text = to_unicode(text) 209 match = re.match(self._code_block_re, unicode(text))211 match = re.match(self._code_block_re, text) 210 212 if match: 211 213 if match.group(1) and 'code' in match.group(1): 212 214 content_for_span = match.group(2) 213 215 else: 214 216 interrupt_paragraph = True 215 elif text.startswith('<table'):217 elif re.match(self._block_elem_re, text): 216 218 interrupt_paragraph = True 217 219 if content_for_span: 218 220 text = tag.span(class_='code-block')(*content_for_span)
