Home | Trees | Indices | Help |
|
---|
|
object --+ | Cleaner
Instances cleans the document of each of the possible offending elements. The cleaning is controlled by attributes; you can override attributes in a subclass, or set them in the constructor.
A list or set of hosts that you can use for embedded content (for content like <object>, <link rel="stylesheet">, etc). You can also implement/override the method allow_embedded_url(el, url) or allow_element(el) to implement more complex rules for what can be embedded. Anything that passes this test will be shown, regardless of the value of (for instance) embedded.
Note that this parameter might not work as intended if you do not make the links absolute before doing the cleaning.
Note that you may also need to set whitelist_tags.
This modifies the document in place.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
scripts = True
|
|||
javascript = True
|
|||
comments = True
|
|||
style = False
|
|||
inline_style = None hash(x) |
|||
links = True
|
|||
meta = True
|
|||
page_structure = True
|
|||
processing_instructions = True
|
|||
embedded = True
|
|||
frames = True
|
|||
forms = True
|
|||
annoying_tags = True
|
|||
remove_tags = None hash(x) |
|||
allow_tags = None hash(x) |
|||
kill_tags = None hash(x) |
|||
remove_unknown_tags = True
|
|||
safe_attrs_only = True
|
|||
safe_attrs =
|
|||
add_nofollow = False
|
|||
host_whitelist =
|
|||
whitelist_tags =
|
|||
_tag_link_attrs =
|
|||
__qualname__ =
|
|
|||
Inherited from |
|
|
Depending on the browser, stuff like e x p r e s s i o n(...) can get interpreted, or expre/* stuff */ssion(...). This checks for attempt to do stuff like this. Typically the response will be to kill the entire style; if you have just a bit of Javascript in the style another rule will catch that and remove only the Javascript from the style; this catches more sneaky attempts. |
|
safe_attrs
|
_tag_link_attrs
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Sep 9 15:24:18 2018 | http://epydoc.sourceforge.net |