old_contents: from django import template
  from django.template.defaultfilters import stringfilter
  from django.utils.safestring import mark_safe
  from django.utils.encoding import force_unicode
  import markdown2
  
  
  register = template.Library()
  
  @register.filter(is_safe=True)
  @stringfilter
  def markdown(value):
      return mark_safe(markdown2.markdown(force_unicode(value),safe_mode='escape'))
  
new_contents: from django import template
  from django.template.defaultfilters import stringfilter
  from django.utils.safestring import mark_safe
  from django.utils.encoding import force_unicode
  import markdown2
  
  
  register = template.Library()
  
  @register.filter(is_safe=True)
  @stringfilter
  def markdown(value,mode='escape'):
      return mark_safe(markdown2.markdown(force_unicode(value),safe_mode=mode))
  
subject: Allow to change the safe_mode of markdown templatetag