pybitmessage.bitmessageqt.safehtmlparser module¶
Subclass of HTMLParser.HTMLParser for MessageView widget
-
class
SafeHTMLParser
(*args, **kwargs)[source]¶ Bases:
HTMLParser.HTMLParser
HTML parser with sanitisation
-
acceptable_elements
= ('a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'big', 'blockquote', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'event-source', 'fieldset', 'figcaption', 'figure', 'footer', 'font', 'header', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'ins', 'keygen', 'kbd', 'label', 'legend', 'li', 'm', 'map', 'menu', 'meter', 'multicol', 'nav', 'nextid', 'ol', 'output', 'optgroup', 'option', 'p', 'pre', 'progress', 'q', 's', 'samp', 'section', 'select', 'small', 'sound', 'source', 'spacer', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'time', 'tfoot', 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'video')¶
-
add_if_acceptable
(tag, attrs=None)¶ Add tag if it passes sanitisation
-
emailregex
= <_sre.SRE_Pattern object>¶
-
feed
(data)¶
-
handle_charref
(name)¶
-
handle_data
(data)¶
-
handle_endtag
(tag)¶
-
handle_entityref
(name)¶
-
handle_startendtag
(tag, attrs)¶
-
handle_starttag
(tag, attrs)¶
-
is_html
(text=None, allow_picture=False)¶ Detect if string contains HTML tags
-
static
replace_post
(text)¶ Perform substring replacement after regex replacements
-
static
replace_pre
(text)¶ Perform substring replacement before regex replacements
-
replaces_post
= (('\n', '<br/>'), ('\t', ' '), (' ', ' '), (' ', ' '), ('<br/> ', '<br/> '))¶
-
replaces_pre
= (('&', '&'), ('"', '"'), ('<', '<'), ('>', '>'))¶
-
reset_safe
()¶ Reset runtime variables specific to this class
-
src_schemes
= ['data']¶
-
uriregex1
= <_sre.SRE_Pattern object>¶
-
uriregex2
= <_sre.SRE_Pattern object>¶
-