comparison src/plugins/plugin_misc_text_syntaxes.py @ 1867:47108a4f3a70

plugin text syntaxes: added 'poster' and 'controls' in allowed attributes for cleanXHTML
author Goffi <goffi@goffi.org>
date Tue, 01 Mar 2016 16:36:16 +0100
parents d8c6c55aafd7
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1866:397ef87958b9 1867:47108a4f3a70
40 40
41 # TODO: check/adapt following list 41 # TODO: check/adapt following list
42 # list initialy based on feedparser list (http://pythonhosted.org/feedparser/html-sanitization.html) 42 # list initialy based on feedparser list (http://pythonhosted.org/feedparser/html-sanitization.html)
43 STYLES_WHITELIST = ("azimuth", "background-color", "border-bottom-color", "border-collapse", "border-color", "border-left-color", "border-right-color", "border-top-color", "clear", "color", "cursor", "direction", "display", "elevation", "float", "font", "font-family", "font-size", "font-style", "font-variant", "font-weight", "height", "letter-spacing", "line-height", "overflow", "pause", "pause-after", "pause-before", "pitch", "pitch-range", "richness", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "text-align", "text-decoration", "text-indent", "unicode-bidi", "vertical-align", "voice-family", "volume", "white-space", "width") 43 STYLES_WHITELIST = ("azimuth", "background-color", "border-bottom-color", "border-collapse", "border-color", "border-left-color", "border-right-color", "border-top-color", "clear", "color", "cursor", "direction", "display", "elevation", "float", "font", "font-family", "font-size", "font-style", "font-variant", "font-weight", "height", "letter-spacing", "line-height", "overflow", "pause", "pause-after", "pause-before", "pitch", "pitch-range", "richness", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "text-align", "text-decoration", "text-indent", "unicode-bidi", "vertical-align", "voice-family", "volume", "white-space", "width")
44 44
45 SAFE_ATTRS = html.defs.safe_attrs.union(('style',)) 45 SAFE_ATTRS = html.defs.safe_attrs.union(('style', 'poster', 'controls'))
46 STYLES_VALUES_REGEX = r'^(' + '|'.join(['([a-z-]+)', # alphabetical names 46 STYLES_VALUES_REGEX = r'^(' + '|'.join(['([a-z-]+)', # alphabetical names
47 '(#[0-9a-f]+)', # hex value 47 '(#[0-9a-f]+)', # hex value
48 '(\d+(.\d+)? *(|%|em|ex|px|in|cm|mm|pt|pc))', # values with units (or not) 48 '(\d+(.\d+)? *(|%|em|ex|px|in|cm|mm|pt|pc))', # values with units (or not)
49 'rgb\( *((\d+(.\d+)?), *){2}(\d+(.\d+)?) *\)', # rgb function 49 'rgb\( *((\d+(.\d+)?), *){2}(\d+(.\d+)?) *\)', # rgb function
50 'rgba\( *((\d+(.\d+)?), *){3}(\d+(.\d+)?) *\)', # rgba function 50 'rgba\( *((\d+(.\d+)?), *){3}(\d+(.\d+)?) *\)', # rgba function