use it to wrap a string that contains XML/HTML so that it will not be
escaped by the template
|
__init__(self,
text,
sanitize=False,
permitted_tags=[ ' a ' , ' b ' , ' blockquote ' , ' br/ ' , ' i ' , ' li ' , ' ol ' , ' ul ' , ' p ' , ' c ... ,
allowed_attributes={ ' a ' : [ ' href ' , ' title ' , ' target ' ] , ' blockquote ' : [ ' type ' ] , ' im ... )
Args:
text: the XML text
sanitize: sanitize text using the permitted tags and allowed
attributes (default False)
permitted_tags: list of permitted tags (default: simple list of
tags)
allowed_attributes: dictionary of allowed attributed (default
for A, IMG and BlockQuote). |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flatten(self,
render=None)
returns the text stored by the XML object rendered by the `render`
function |
source code
|
|
|
elements(self,
*args,
**kargs)
to be considered experimental since the behavior of this method is
questionable another option could be
`TAG(self.text).elements(*args,**kwargs)` |
source code
|
|
Inherited from XmlComponent :
__mul__ ,
add_class ,
remove_class
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|