Commits

David Chambers  committed 6c845d0

Slightly improved the way in which the excerpt and update regular expressions are constructed.

  • Participants
  • Parent commits db5e472

Comments (0)

Files changed (1)

 import mango.settings
 from mango.settings import *
 
-block = [r'(?m)^(', r'(?=[ \n])[^\n]*(\n|$))+']
-match = [r'(?m)^', r'(?=[ \n]) ?']
+block = r'(?m)^(%s(?=[ \n])[^\n]*(\n|$))+'
+match = r'(?m)^%s(?=[ \n]) ?'
 
 RE = {
     '\r\n?':         re.compile(r'\r\n?'),
 
     # excerpts
     'hand-crafted':  re.compile(r' {,3}\S+:.*(\n[ \t]*\S+:.*)*\n{2,}(?P<excerpt>(\|(?=[ \n])[^\n]*\n)+)'),
-    'excerpt':       re.compile(r'\|'.join(block)),
-    'excerpt_pipes': re.compile(r'\|'.join(match)),
+    'excerpt':       re.compile(block % r'\|'),
+    'excerpt_pipes': re.compile(match % r'\|'),
 
     # updates
-    'update':        re.compile(r'\|\|'.join(block)),
-    'update_pipes':  re.compile(r'\|\|'.join(match)),
+    'update':        re.compile(block % r'\|\|'),
+    'update_pipes':  re.compile(match % r'\|\|'),
 
     # {{ filesize }} following internal links
     'ref-style':     re.compile(r'(\[(?P<id>[^\]]+)\]\s*){{\s*filesize\s*}}'),