Commits

Chris Chambers committed 8e11195

Moving the update regex search to inside the parse_text, not ideal as it causes recursion but allows updates inside excerpts

  • Participants
  • Parent commits 7649563

Comments (0)

Files changed (1)

         return u'' # fail silently
 
 def parse_text(text):
+
+    t = loader.get_template('update.dhtml')
+
+    for match in re.finditer(RE['update'], text):
+        capture = match.group(0)
+        c = Context(parse_text(re.sub(RE['update_pipes'], '', capture)))
+        text = text.replace(capture, t.render(c))
     md = markdown.Markdown(extensions = ('meta',) + MARKDOWN_EXTENSIONS)
     html = md.convert(text)
 
             excerpt += snippet + '\n'
             text = text.replace(capture, snippet)
 
-    t = loader.get_template('update.dhtml')
-
-    for match in re.finditer(RE['update'], text):
-        capture = match.group(0)
-        c = Context(parse_text(re.sub(RE['update_pipes'], '', capture)))
-        text = text.replace(capture, t.render(c))
-
     ret = parse_text(text)
     ret['excerpt'] =  excerpt if excerpt else ret['html']
     cache.set(filepath, {'data': ret, 'mod_time': os.path.getmtime(filepath)}, POST_CACHE_SECONDS)