MCPcopy Index your code
hub / github.com/pyload/pyload / _HTMLSanitizer

Class _HTMLSanitizer

module/lib/feedparser.py:2487–2722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2485 return uri
2486
2487class _HTMLSanitizer(_BaseHTMLProcessor):
2488 acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',
2489 'article', 'aside', 'audio', 'b', 'big', 'blockquote', 'br', 'button',
2490 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
2491 'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn',
2492 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'event-source', 'fieldset',
2493 'figcaption', 'figure', 'footer', 'font', 'form', 'header', 'h1',
2494 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', 'ins',
2495 'keygen', 'kbd', 'label', 'legend', 'li', 'm', 'map', 'menu', 'meter',
2496 'multicol', 'nav', 'nextid', 'ol', 'output', 'optgroup', 'option',
2497 'p', 'pre', 'progress', 'q', 's', 'samp', 'section', 'select',
2498 'small', 'sound', 'source', 'spacer', 'span', 'strike', 'strong',
2499 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'time', 'tfoot',
2500 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'video', 'noscript']
2501
2502 acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey',
2503 'action', 'align', 'alt', 'autocomplete', 'autofocus', 'axis',
2504 'background', 'balance', 'bgcolor', 'bgproperties', 'border',
2505 'bordercolor', 'bordercolordark', 'bordercolorlight', 'bottompadding',
2506 'cellpadding', 'cellspacing', 'ch', 'challenge', 'char', 'charoff',
2507 'choff', 'charset', 'checked', 'cite', 'class', 'clear', 'color', 'cols',
2508 'colspan', 'compact', 'contenteditable', 'controls', 'coords', 'data',
2509 'datafld', 'datapagesize', 'datasrc', 'datetime', 'default', 'delay',
2510 'dir', 'disabled', 'draggable', 'dynsrc', 'enctype', 'end', 'face', 'for',
2511 'form', 'frame', 'galleryimg', 'gutter', 'headers', 'height', 'hidefocus',
2512 'hidden', 'high', 'href', 'hreflang', 'hspace', 'icon', 'id', 'inputmode',
2513 'ismap', 'keytype', 'label', 'leftspacing', 'lang', 'list', 'longdesc',
2514 'loop', 'loopcount', 'loopend', 'loopstart', 'low', 'lowsrc', 'max',
2515 'maxlength', 'media', 'method', 'min', 'multiple', 'name', 'nohref',
2516 'noshade', 'nowrap', 'open', 'optimum', 'pattern', 'ping', 'point-size',
2517 'prompt', 'pqg', 'radiogroup', 'readonly', 'rel', 'repeat-max',
2518 'repeat-min', 'replace', 'required', 'rev', 'rightspacing', 'rows',
2519 'rowspan', 'rules', 'scope', 'selected', 'shape', 'size', 'span', 'src',
2520 'start', 'step', 'summary', 'suppress', 'tabindex', 'target', 'template',
2521 'title', 'toppadding', 'type', 'unselectable', 'usemap', 'urn', 'valign',
2522 'value', 'variable', 'volume', 'vspace', 'vrml', 'width', 'wrap',
2523 'xml:lang']
2524
2525 unacceptable_elements_with_end_tag = ['script', 'applet', 'style']
2526
2527 acceptable_css_properties = ['azimuth', 'background-color',
2528 'border-bottom-color', 'border-collapse', 'border-color',
2529 'border-left-color', 'border-right-color', 'border-top-color', 'clear',
2530 'color', 'cursor', 'direction', 'display', 'elevation', 'float', 'font',
2531 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight',
2532 'height', 'letter-spacing', 'line-height', 'overflow', 'pause',
2533 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'richness',
2534 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation',
2535 'speech-rate', 'stress', 'text-align', 'text-decoration', 'text-indent',
2536 'unicode-bidi', 'vertical-align', 'voice-family', 'volume',
2537 'white-space', 'width']
2538
2539 # survey of common keywords found in feeds
2540 acceptable_css_keywords = ['auto', 'aqua', 'black', 'block', 'blue',
2541 'bold', 'both', 'bottom', 'brown', 'center', 'collapse', 'dashed',
2542 'dotted', 'fuchsia', 'gray', 'green', '!important', 'italic', 'left',
2543 'lime', 'maroon', 'medium', 'none', 'navy', 'normal', 'nowrap', 'olive',
2544 'pointer', 'purple', 'red', 'right', 'solid', 'silver', 'teal', 'top',

Callers 1

_sanitizeHTMLFunction · 0.85

Calls 1

compileMethod · 0.80

Tested by

no test coverage detected