MCPcopy Index your code
hub / github.com/clips/pattern / _HTMLSanitizer

Class _HTMLSanitizer

pattern/web/feed/feedparser.py:2600–2856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2598 return uri
2599
2600class _HTMLSanitizer(_BaseHTMLProcessor):
2601 acceptable_elements = set(['a', 'abbr', 'acronym', 'address', 'area',
2602 'article', 'aside', 'audio', 'b', 'big', 'blockquote', 'br', 'button',
2603 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
2604 'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn',
2605 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'event-source', 'fieldset',
2606 'figcaption', 'figure', 'footer', 'font', 'form', 'header', 'h1',
2607 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', 'ins',
2608 'keygen', 'kbd', 'label', 'legend', 'li', 'm', 'map', 'menu', 'meter',
2609 'multicol', 'nav', 'nextid', 'ol', 'output', 'optgroup', 'option',
2610 'p', 'pre', 'progress', 'q', 's', 'samp', 'section', 'select',
2611 'small', 'sound', 'source', 'spacer', 'span', 'strike', 'strong',
2612 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'time', 'tfoot',
2613 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'video', 'noscript'])
2614
2615 acceptable_attributes = set(['abbr', 'accept', 'accept-charset', 'accesskey',
2616 'action', 'align', 'alt', 'autocomplete', 'autofocus', 'axis',
2617 'background', 'balance', 'bgcolor', 'bgproperties', 'border',
2618 'bordercolor', 'bordercolordark', 'bordercolorlight', 'bottompadding',
2619 'cellpadding', 'cellspacing', 'ch', 'challenge', 'char', 'charoff',
2620 'choff', 'charset', 'checked', 'cite', 'class', 'clear', 'color', 'cols',
2621 'colspan', 'compact', 'contenteditable', 'controls', 'coords', 'data',
2622 'datafld', 'datapagesize', 'datasrc', 'datetime', 'default', 'delay',
2623 'dir', 'disabled', 'draggable', 'dynsrc', 'enctype', 'end', 'face', 'for',
2624 'form', 'frame', 'galleryimg', 'gutter', 'headers', 'height', 'hidefocus',
2625 'hidden', 'high', 'href', 'hreflang', 'hspace', 'icon', 'id', 'inputmode',
2626 'ismap', 'keytype', 'label', 'leftspacing', 'lang', 'list', 'longdesc',
2627 'loop', 'loopcount', 'loopend', 'loopstart', 'low', 'lowsrc', 'max',
2628 'maxlength', 'media', 'method', 'min', 'multiple', 'name', 'nohref',
2629 'noshade', 'nowrap', 'open', 'optimum', 'pattern', 'ping', 'point-size',
2630 'prompt', 'pqg', 'radiogroup', 'readonly', 'rel', 'repeat-max',
2631 'repeat-min', 'replace', 'required', 'rev', 'rightspacing', 'rows',
2632 'rowspan', 'rules', 'scope', 'selected', 'shape', 'size', 'span', 'src',
2633 'start', 'step', 'summary', 'suppress', 'tabindex', 'target', 'template',
2634 'title', 'toppadding', 'type', 'unselectable', 'usemap', 'urn', 'valign',
2635 'value', 'variable', 'volume', 'vspace', 'vrml', 'width', 'wrap',
2636 'xml:lang'])
2637
2638 unacceptable_elements_with_end_tag = set(['script', 'applet', 'style'])
2639
2640 acceptable_css_properties = set(['azimuth', 'background-color',
2641 'border-bottom-color', 'border-collapse', 'border-color',
2642 'border-left-color', 'border-right-color', 'border-top-color', 'clear',
2643 'color', 'cursor', 'direction', 'display', 'elevation', 'float', 'font',
2644 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight',
2645 'height', 'letter-spacing', 'line-height', 'overflow', 'pause',
2646 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'richness',
2647 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation',
2648 'speech-rate', 'stress', 'text-align', 'text-decoration', 'text-indent',
2649 'unicode-bidi', 'vertical-align', 'voice-family', 'volume',
2650 'white-space', 'width'])
2651
2652 # survey of common keywords found in feeds
2653 acceptable_css_keywords = set(['auto', 'aqua', 'black', 'block', 'blue',
2654 'bold', 'both', 'bottom', 'brown', 'center', 'collapse', 'dashed',
2655 'dotted', 'fuchsia', 'gray', 'green', '!important', 'italic', 'left',
2656 'lime', 'maroon', 'medium', 'none', 'navy', 'normal', 'nowrap', 'olive',
2657 'pointer', 'purple', 'red', 'right', 'solid', 'silver', 'teal', 'top',

Callers 1

_sanitizeHTMLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…