App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Functions | Variables
google.appengine._internal.django.utils.html Namespace Reference

Functions

def escape
 

Variables

list LEADING_PUNCTUATION = ['(', '<', '&lt;']
 
list TRAILING_PUNCTUATION = ['.', ',', ')', '>', '\n', '&gt;']
 
list DOTS = ['&middot;', '*', '\xe2\x80\xa2', '&#149;', '&bull;', '&#8226;']
 
tuple unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
 
tuple word_split_re = re.compile(r'(\s+)')
 
tuple punctuation_re
 
tuple simple_email_re = re.compile(r'^\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$')
 
tuple link_target_attribute_re = re.compile(r'(<a [^>]*?)target=[^\s>]+')
 
tuple html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)
 
tuple hard_coded_bullets_re = re.compile(r'((?:<p>(?:%s).*?[a-zA-Z].*?</p>\s*)+)' % '|'.join([re.escape(x) for x in DOTS]), re.DOTALL)
 
tuple trailing_empty_content_re = re.compile(r'(?:<p>(?:&nbsp;|\s|<br \/>)*?</p>\s*)+\Z')
 
tuple escape = allow_lazy(escape, unicode)
 

Detailed Description

HTML utilities suitable for global use.

Function Documentation

def google.appengine._internal.django.utils.html.escape (   html)
Returns the given HTML with ampersands, quotes and angle brackets encoded.

Variable Documentation

tuple google.appengine._internal.django.utils.html.punctuation_re
Initial value:
1 = re.compile('^(?P<lead>(?:%s)*)(?P<middle>.*?)(?P<trail>(?:%s)*)$' % ('|'.join([re.escape(x) for x in LEADING_PUNCTUATION]),
2  '|'.join([re.escape(x) for x in TRAILING_PUNCTUATION])))