Commits

David Chambers committed f678820

Added calls to `reset` to prevent stray links (e.g. "[Mango][1]" where "1" is undefined) from reusing URLs from previously-converted documents.

Comments (0)

Files changed (2)

             snippet = re.sub(RE['excerpt_pipes'], u'', capture)
             snippets.append(snippet)
             contents = contents.replace(capture, snippet)
+        md.reset()
         self.excerpt = md.convert('\n\n'.join(snippets))
 
         # updates
         split = re.split(RE['update'], contents)
+        md.reset()
         chunks = md.convert(u'\n<mango/>\n'.join(split[0::2])).split('<mango/>')
         self.meta = getattr(md, 'Meta', {})
         updates = [update_template.render(Context({'update': Document(parent=self).convert(item)})) for item in split[1::2]]

templatetags/mango_extras.py

 @register.filter
 @stringfilter
 def convert(string):
+    md.reset()
     return mark_safe(md.convert(string))
 
 @register.filter