      return value.replace('\n', '<br />')
  linebreaksbr = stringfilter(linebreaksbr)
  
  def removetags(value, tags):
      "Removes a space separated list of [X]HTML tags from the output"
      tags = [re.escape(tag) for tag in tags.split()]
      tags_re = u'(%s)' % u'|'.join(tags)
      starttag_re = re.compile(ur'<%s(/?>|(\s+[^>]*>))' % tags_re, re.U)
      endtag_re = re.compile(u'</%s>' % tags_re)
      value = starttag_re.sub(u'', value)
 
</s> remove     "Escapes an IRI value for use in a URL"
 </s> add     """Escapes an IRI value for use in a URL.""" </s> remove             raise TemplateSyntaxError, "'%s' is not a valid tag library: %s" % (taglib, e)
 </s> add             raise TemplateSyntaxError("'%s' is not a valid tag library: %s" %
                                      (taglib, e)) </s> remove     "Strips all [X]HTML tags"
 </s> add     """Strips all [X]HTML tags.""" </s> remove             raise TemplateSyntaxError, "'for' tag received an invalid argument: %s" % token.contents
 </s> add             raise TemplateSyntaxError("'for' tag received an invalid argument:"
                                      " %s" % token.contents) </s> remove     "Centers the value in a field of a given width"
 </s> add     """Centers the value in a field of a given width."""
    """Removes a space separated list of [X]HTML tags from the output."""
      return value.replace('\n', '<br />')
  linebreaksbr = stringfilter(linebreaksbr)
  
  def removetags(value, tags):
    """Removes a space separated list of [X]HTML tags from the output."""
      tags = [re.escape(tag) for tag in tags.split()]
      tags_re = u'(%s)' % u'|'.join(tags)
      starttag_re = re.compile(ur'<%s(/?>|(\s+[^>]*>))' % tags_re, re.U)
      endtag_re = re.compile(u'</%s>' % tags_re)
      value = starttag_re.sub(u'', value)
keep keep keep keep replace keep keep keep keep keep
 Style and import fixes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6641 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/template/defaultfilters.py