OpenQuizz
Une application de gestion des contenus pédagogiques
Filter Class Reference
Inheritance diagram for Filter:
Collaboration diagram for Filter:

Public Member Functions

def __init__ (self, source, allowed_elements=allowed_elements, allowed_attributes=allowed_attributes, allowed_css_properties=allowed_css_properties, allowed_css_keywords=allowed_css_keywords, allowed_svg_properties=allowed_svg_properties, allowed_protocols=allowed_protocols, allowed_content_types=allowed_content_types, attr_val_is_uri=attr_val_is_uri, svg_attr_val_allows_ref=svg_attr_val_allows_ref, svg_allow_local_href=svg_allow_local_href)
 
def __iter__ (self)
 
def sanitize_token (self, token)
 
def allowed_token (self, token)
 
def disallowed_token (self, token)
 
def sanitize_css (self, style)
 
- Public Member Functions inherited from Filter
def __init__ (self, source)
 
def __getattr__ (self, name)
 

Data Fields

 allowed_elements
 
 allowed_attributes
 
 allowed_css_properties
 
 allowed_css_keywords
 
 allowed_svg_properties
 
 allowed_protocols
 
 allowed_content_types
 
 attr_val_is_uri
 
 svg_attr_val_allows_ref
 
 svg_allow_local_href
 
- Data Fields inherited from Filter
 source
 

Detailed Description

Sanitizes token stream of XHTML+MathML+SVG and of inline style attributes

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  source,
  allowed_elements = allowed_elements,
  allowed_attributes = allowed_attributes,
  allowed_css_properties = allowed_css_properties,
  allowed_css_keywords = allowed_css_keywords,
  allowed_svg_properties = allowed_svg_properties,
  allowed_protocols = allowed_protocols,
  allowed_content_types = allowed_content_types,
  attr_val_is_uri = attr_val_is_uri,
  svg_attr_val_allows_ref = svg_attr_val_allows_ref,
  svg_allow_local_href = svg_allow_local_href 
)
Creates a Filter

:arg allowed_elements: set of elements to allow--everything else will
    be escaped

:arg allowed_attributes: set of attributes to allow in
    elements--everything else will be stripped

:arg allowed_css_properties: set of CSS properties to allow--everything
    else will be stripped

:arg allowed_css_keywords: set of CSS keywords to allow--everything
    else will be stripped

:arg allowed_svg_properties: set of SVG properties to allow--everything
    else will be removed

:arg allowed_protocols: set of allowed protocols for URIs

:arg allowed_content_types: set of allowed content types for ``data`` URIs.

:arg attr_val_is_uri: set of attributes that have URI values--values
    that have a scheme not listed in ``allowed_protocols`` are removed

:arg svg_attr_val_allows_ref: set of SVG attributes that can have
    references

:arg svg_allow_local_href: set of SVG elements that can have local
    hrefs--these are removed

Member Function Documentation

◆ __iter__()

def __iter__ (   self)

Reimplemented from Filter.

◆ allowed_token()

def allowed_token (   self,
  token 
)

◆ disallowed_token()

def disallowed_token (   self,
  token 
)

◆ sanitize_css()

def sanitize_css (   self,
  style 
)

◆ sanitize_token()

def sanitize_token (   self,
  token 
)

Field Documentation

◆ allowed_attributes

allowed_attributes

◆ allowed_content_types

allowed_content_types

◆ allowed_css_keywords

allowed_css_keywords

◆ allowed_css_properties

allowed_css_properties

◆ allowed_elements

allowed_elements

◆ allowed_protocols

allowed_protocols

◆ allowed_svg_properties

allowed_svg_properties

◆ attr_val_is_uri

attr_val_is_uri

◆ svg_allow_local_href

svg_allow_local_href

◆ svg_attr_val_allows_ref

svg_attr_val_allows_ref

The documentation for this class was generated from the following file: