##// END OF EJS Templates
markdown: fixed sanitization of checkbox extensions that removed "checked" attribute....
dan -
r3528:74d317ee stable
parent child Browse files
Show More
@@ -1,405 +1,405 b''
1 all_tags = [
1 all_tags = [
2 "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio",
2 "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio",
3 "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button",
3 "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button",
4 "canvas", "caption", "center", "cite", "code", "col", "colgroup", "command", "content",
4 "canvas", "caption", "center", "cite", "code", "col", "colgroup", "command", "content",
5 "data", "datalist", "dd", "del", "detals", "dfn", "dialog", "dir", "div", "dl", "dt",
5 "data", "datalist", "dd", "del", "detals", "dfn", "dialog", "dir", "div", "dl", "dt",
6 "element", "em", "embed",
6 "element", "em", "embed",
7 "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset",
7 "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset",
8 "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html",
8 "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html",
9 "i", "iframe", "image", "img", "input", "ins", "isindex",
9 "i", "iframe", "image", "img", "input", "ins", "isindex",
10 "kbd", "keygen",
10 "kbd", "keygen",
11 "label", "legend", "li", "link", "listing",
11 "label", "legend", "li", "link", "listing",
12 "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "multicol",
12 "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "multicol",
13 "nav", "nobr", "noembed", "noframes", "noscript",
13 "nav", "nobr", "noembed", "noframes", "noscript",
14 "object", "ol", "optgroup", "option", "output",
14 "object", "ol", "optgroup", "option", "output",
15 "p", "param", "picture", "plaintext", "pre", "progress",
15 "p", "param", "picture", "plaintext", "pre", "progress",
16 "q",
16 "q",
17 "rp", "rt", "ruby",
17 "rp", "rt", "ruby",
18 "s", "samp", "script", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup",
18 "s", "samp", "script", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup",
19 "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt",
19 "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt",
20 "u", "ul",
20 "u", "ul",
21 "var", "video",
21 "var", "video",
22 "wbr",
22 "wbr",
23 "xmp",
23 "xmp",
24 ]
24 ]
25
25
26 # List tags that, if included in a page, could break markup or open XSS.
26 # List tags that, if included in a page, could break markup or open XSS.
27 generally_xss_unsafe = [
27 generally_xss_unsafe = [
28 "applet", "audio",
28 "applet", "audio",
29 "bgsound", "body",
29 "bgsound", "body",
30 "canvas",
30 "canvas",
31 "embed",
31 "embed",
32 "frame", "frameset",
32 "frame", "frameset",
33 "head", "html",
33 "head", "html",
34 "iframe",
34 "iframe",
35 "link",
35 "link",
36 "meta",
36 "meta",
37 "object",
37 "object",
38 "param",
38 "param",
39 "source", "script",
39 "source", "script",
40 "ruby", "rt",
40 "ruby", "rt",
41 "title", "track",
41 "title", "track",
42 "video",
42 "video",
43 "xmp"
43 "xmp"
44 ]
44 ]
45
45
46 # Tags that, if included on the page, will probably not break markup or open
46 # Tags that, if included on the page, will probably not break markup or open
47 # XSS. Note that these must be combined with attribute whitelisting, or things
47 # XSS. Note that these must be combined with attribute whitelisting, or things
48 # like <img> and <style> could still be unsafe.
48 # like <img> and <style> could still be unsafe.
49 generally_xss_safe = list(set(all_tags) - set(generally_xss_unsafe))
49 generally_xss_safe = list(set(all_tags) - set(generally_xss_unsafe))
50 generally_xss_safe.sort()
50 generally_xss_safe.sort()
51
51
52 # Tags suitable for rendering markdown
52 # Tags suitable for rendering markdown
53 markdown_tags = [
53 markdown_tags = [
54 "h1", "h2", "h3", "h4", "h5", "h6",
54 "h1", "h2", "h3", "h4", "h5", "h6",
55 "b", "i", "strong", "em", "tt",
55 "b", "i", "strong", "em", "tt",
56 "p", "br",
56 "p", "br",
57 "span", "div", "blockquote", "code", "hr", "pre", "del",
57 "span", "div", "blockquote", "code", "hr", "pre", "del",
58 "ul", "ol", "li",
58 "ul", "ol", "li",
59 "dl", "dd", "dt",
59 "dl", "dd", "dt",
60 "table", "thead", "tbody", "tfoot", "tr", "th", "td",
60 "table", "thead", "tbody", "tfoot", "tr", "th", "td",
61 "img",
61 "img",
62 "a",
62 "a",
63 "input",
63 "input",
64 ]
64 ]
65
65
66 markdown_attrs = {
66 markdown_attrs = {
67 "*": ["class", "style", "align"],
67 "*": ["class", "style", "align"],
68 "img": ["src", "alt", "title"],
68 "img": ["src", "alt", "title"],
69 "a": ["href", "alt", "title", "name"],
69 "a": ["href", "alt", "title", "name"],
70 "abbr": ["title"],
70 "abbr": ["title"],
71 "acronym": ["title"],
71 "acronym": ["title"],
72 "pre": ["lang"],
72 "pre": ["lang"],
73 "input": ["type", "disabled"]
73 "input": ["type", "disabled", "checked"]
74 }
74 }
75
75
76 standard_styles = [
76 standard_styles = [
77 # Taken from https://developer.mozilla.org/en-US/docs/Web/CSS/Reference
77 # Taken from https://developer.mozilla.org/en-US/docs/Web/CSS/Reference
78 # This includes pseudo-classes, pseudo-elements, @-rules, units, and
78 # This includes pseudo-classes, pseudo-elements, @-rules, units, and
79 # selectors in addition to properties, but it doesn't matter for our
79 # selectors in addition to properties, but it doesn't matter for our
80 # purposes -- we don't need to filter styles..
80 # purposes -- we don't need to filter styles..
81 ":active", "::after (:after)", "align-content", "align-items", "align-self",
81 ":active", "::after (:after)", "align-content", "align-items", "align-self",
82 "all", "<angle>", "animation", "animation-delay", "animation-direction",
82 "all", "<angle>", "animation", "animation-delay", "animation-direction",
83 "animation-duration", "animation-fill-mode", "animation-iteration-count",
83 "animation-duration", "animation-fill-mode", "animation-iteration-count",
84 "animation-name", "animation-play-state", "animation-timing-function",
84 "animation-name", "animation-play-state", "animation-timing-function",
85 "@annotation", "annotation()", "attr()", "::backdrop", "backface-visibility",
85 "@annotation", "annotation()", "attr()", "::backdrop", "backface-visibility",
86 "background", "background-attachment", "background-blend-mode",
86 "background", "background-attachment", "background-blend-mode",
87 "background-clip", "background-color", "background-image", "background-origin",
87 "background-clip", "background-color", "background-image", "background-origin",
88 "background-position", "background-repeat", "background-size", "<basic-shape>",
88 "background-position", "background-repeat", "background-size", "<basic-shape>",
89 "::before (:before)", "<blend-mode>", "blur()", "border", "border-bottom",
89 "::before (:before)", "<blend-mode>", "blur()", "border", "border-bottom",
90 "border-bottom-color", "border-bottom-left-radius",
90 "border-bottom-color", "border-bottom-left-radius",
91 "border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
91 "border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
92 "border-collapse", "border-color", "border-image", "border-image-outset",
92 "border-collapse", "border-color", "border-image", "border-image-outset",
93 "border-image-repeat", "border-image-slice", "border-image-source",
93 "border-image-repeat", "border-image-slice", "border-image-source",
94 "border-image-width", "border-left", "border-left-color", "border-left-style",
94 "border-image-width", "border-left", "border-left-color", "border-left-style",
95 "border-left-width", "border-radius", "border-right", "border-right-color",
95 "border-left-width", "border-radius", "border-right", "border-right-color",
96 "border-right-style", "border-right-width", "border-spacing", "border-style",
96 "border-right-style", "border-right-width", "border-spacing", "border-style",
97 "border-top", "border-top-color", "border-top-left-radius",
97 "border-top", "border-top-color", "border-top-left-radius",
98 "border-top-right-radius", "border-top-style", "border-top-width",
98 "border-top-right-radius", "border-top-style", "border-top-width",
99 "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
99 "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
100 "break-after", "break-before", "break-inside", "brightness()", "calc()",
100 "break-after", "break-before", "break-inside", "brightness()", "calc()",
101 "caption-side", "ch", "@character-variant", "character-variant()", "@charset",
101 "caption-side", "ch", "@character-variant", "character-variant()", "@charset",
102 ":checked", "circle()", "clear", "clip", "clip-path", "cm", "color", "<color>",
102 ":checked", "circle()", "clear", "clip", "clip-path", "cm", "color", "<color>",
103 "columns", "column-count", "column-fill", "column-gap", "column-rule",
103 "columns", "column-count", "column-fill", "column-gap", "column-rule",
104 "column-rule-color", "column-rule-style", "column-rule-width", "column-span",
104 "column-rule-color", "column-rule-style", "column-rule-width", "column-span",
105 "column-width", "content", "contrast()", "<counter>", "counter-increment",
105 "column-width", "content", "contrast()", "<counter>", "counter-increment",
106 "counter-reset", "@counter-style", "cubic-bezier()", "cursor",
106 "counter-reset", "@counter-style", "cubic-bezier()", "cursor",
107 "<custom-ident>", ":default", "deg", ":dir()", "direction", ":disabled",
107 "<custom-ident>", ":default", "deg", ":dir()", "direction", ":disabled",
108 "display", "@document", "dpcm", "dpi", "dppx", "drop-shadow()", "element()",
108 "display", "@document", "dpcm", "dpi", "dppx", "drop-shadow()", "element()",
109 "ellipse()", "em", ":empty", "empty-cells", ":enabled", "ex", "filter",
109 "ellipse()", "em", ":empty", "empty-cells", ":enabled", "ex", "filter",
110 ":first", ":first-child", "::first-letter", "::first-line",
110 ":first", ":first-child", "::first-letter", "::first-line",
111 ":first-of-type", "flex", "flex-basis", "flex-direction",
111 ":first-of-type", "flex", "flex-basis", "flex-direction",
112 "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "float", ":focus",
112 "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "float", ":focus",
113 "font", "@font-face", "font-family", "font-feature-settings",
113 "font", "@font-face", "font-family", "font-feature-settings",
114 "@font-feature-values", "font-kerning", "font-language-override", "font-size",
114 "@font-feature-values", "font-kerning", "font-language-override", "font-size",
115 "font-size-adjust", "font-stretch", "font-style", "font-synthesis",
115 "font-size-adjust", "font-stretch", "font-style", "font-synthesis",
116 "font-variant", "font-variant-alternates", "font-variant-caps",
116 "font-variant", "font-variant-alternates", "font-variant-caps",
117 "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
117 "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
118 "font-variant-position", "font-weight", "<frequency>", ":fullscreen", "grad",
118 "font-variant-position", "font-weight", "<frequency>", ":fullscreen", "grad",
119 "<gradient>", "grayscale()", "grid", "grid-area", "grid-auto-columns",
119 "<gradient>", "grayscale()", "grid", "grid-area", "grid-auto-columns",
120 "grid-auto-flow", "grid-auto-position", "grid-auto-rows", "grid-column",
120 "grid-auto-flow", "grid-auto-position", "grid-auto-rows", "grid-column",
121 "grid-column-start", "grid-column-end", "grid-row", "grid-row-start",
121 "grid-column-start", "grid-column-end", "grid-row", "grid-row-start",
122 "grid-row-end", "grid-template", "grid-template-areas", "grid-template-rows",
122 "grid-row-end", "grid-template", "grid-template-areas", "grid-template-rows",
123 "grid-template-columns", "height", ":hover", "hsl()", "hsla()", "hue-rotate()",
123 "grid-template-columns", "height", ":hover", "hsl()", "hsla()", "hue-rotate()",
124 "hyphens", "hz", "<image>", "image()", "image-rendering", "image-resolution",
124 "hyphens", "hz", "<image>", "image()", "image-rendering", "image-resolution",
125 "image-orientation", "ime-mode", "@import", "in", ":indeterminate", "inherit",
125 "image-orientation", "ime-mode", "@import", "in", ":indeterminate", "inherit",
126 "initial", ":in-range", "inset()", "<integer>", ":invalid", "invert()",
126 "initial", ":in-range", "inset()", "<integer>", ":invalid", "invert()",
127 "isolation", "justify-content", "@keyframes", "khz", ":lang()", ":last-child",
127 "isolation", "justify-content", "@keyframes", "khz", ":lang()", ":last-child",
128 ":last-of-type", "left", ":left", "<length>", "letter-spacing",
128 ":last-of-type", "left", ":left", "<length>", "letter-spacing",
129 "linear-gradient()", "line-break", "line-height", ":link", "list-style",
129 "linear-gradient()", "line-break", "line-height", ":link", "list-style",
130 "list-style-image", "list-style-position", "list-style-type", "margin",
130 "list-style-image", "list-style-position", "list-style-type", "margin",
131 "margin-bottom", "margin-left", "margin-right", "margin-top", "marks", "mask",
131 "margin-bottom", "margin-left", "margin-right", "margin-top", "marks", "mask",
132 "mask-type", "matrix()", "matrix3d()", "max-height", "max-width", "@media",
132 "mask-type", "matrix()", "matrix3d()", "max-height", "max-width", "@media",
133 "min-height", "minmax()", "min-width", "mix-blend-mode", "mm", "ms",
133 "min-height", "minmax()", "min-width", "mix-blend-mode", "mm", "ms",
134 "@namespace", ":not()", ":nth-child()", ":nth-last-child()",
134 "@namespace", ":not()", ":nth-child()", ":nth-last-child()",
135 ":nth-last-of-type()", ":nth-of-type()", "<number>", "object-fit",
135 ":nth-last-of-type()", ":nth-of-type()", "<number>", "object-fit",
136 "object-position", ":only-child", ":only-of-type", "opacity", "opacity()",
136 "object-position", ":only-child", ":only-of-type", "opacity", "opacity()",
137 ":optional", "order", "@ornaments", "ornaments()", "orphans", "outline",
137 ":optional", "order", "@ornaments", "ornaments()", "orphans", "outline",
138 "outline-color", "outline-offset", "outline-style", "outline-width",
138 "outline-color", "outline-offset", "outline-style", "outline-width",
139 ":out-of-range", "overflow", "overflow-wrap", "overflow-x", "overflow-y",
139 ":out-of-range", "overflow", "overflow-wrap", "overflow-x", "overflow-y",
140 "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
140 "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
141 "@page", "page-break-after", "page-break-before", "page-break-inside", "pc",
141 "@page", "page-break-after", "page-break-before", "page-break-inside", "pc",
142 "<percentage>", "perspective", "perspective()", "perspective-origin",
142 "<percentage>", "perspective", "perspective()", "perspective-origin",
143 "pointer-events", "polygon()", "position", "<position>", "pt", "px", "quotes",
143 "pointer-events", "polygon()", "position", "<position>", "pt", "px", "quotes",
144 "rad", "radial-gradient()", "<ratio>", ":read-only", ":read-write", "rect()",
144 "rad", "radial-gradient()", "<ratio>", ":read-only", ":read-write", "rect()",
145 "rem", "repeat()", "::repeat-index", "::repeat-item",
145 "rem", "repeat()", "::repeat-index", "::repeat-item",
146 "repeating-linear-gradient()", "repeating-radial-gradient()", ":required",
146 "repeating-linear-gradient()", "repeating-radial-gradient()", ":required",
147 "resize", "<resolution>", "rgb()", "rgba()", "right", ":right", ":root",
147 "resize", "<resolution>", "rgb()", "rgba()", "right", ":right", ":root",
148 "rotate()", "rotatex()", "rotatey()", "rotatez()", "rotate3d()", "ruby-align",
148 "rotate()", "rotatex()", "rotatey()", "rotatez()", "rotate3d()", "ruby-align",
149 "ruby-merge", "ruby-position", "s", "saturate()", "scale()", "scalex()",
149 "ruby-merge", "ruby-position", "s", "saturate()", "scale()", "scalex()",
150 "scaley()", "scalez()", "scale3d()", ":scope", "scroll-behavior",
150 "scaley()", "scalez()", "scale3d()", ":scope", "scroll-behavior",
151 "::selection", "sepia()", "<shape>", "shape-image-threshold", "shape-margin",
151 "::selection", "sepia()", "<shape>", "shape-image-threshold", "shape-margin",
152 "shape-outside", "skew()", "skewx()", "skewy()", "steps()", "<string>",
152 "shape-outside", "skew()", "skewx()", "skewy()", "steps()", "<string>",
153 "@styleset", "styleset()", "@stylistic", "stylistic()", "@supports", "@swash",
153 "@styleset", "styleset()", "@stylistic", "stylistic()", "@supports", "@swash",
154 "swash()", "symbol()", "table-layout", "tab-size", ":target", "text-align",
154 "swash()", "symbol()", "table-layout", "tab-size", ":target", "text-align",
155 "text-align-last", "text-combine-upright", "text-decoration",
155 "text-align-last", "text-combine-upright", "text-decoration",
156 "text-decoration-color", "text-decoration-line", "text-decoration-style",
156 "text-decoration-color", "text-decoration-line", "text-decoration-style",
157 "text-indent", "text-orientation", "text-overflow", "text-rendering",
157 "text-indent", "text-orientation", "text-overflow", "text-rendering",
158 "text-shadow", "text-transform", "text-underline-position", "<time>",
158 "text-shadow", "text-transform", "text-underline-position", "<time>",
159 "<timing-function>", "top", "touch-action", "transform", "transform-origin",
159 "<timing-function>", "top", "touch-action", "transform", "transform-origin",
160 "transform-style", "transition", "transition-delay", "transition-duration",
160 "transform-style", "transition", "transition-delay", "transition-duration",
161 "transition-property", "transition-timing-function", "translate()",
161 "transition-property", "transition-timing-function", "translate()",
162 "translatex()", "translatey()", "translatez()", "translate3d()", "turn",
162 "translatex()", "translatey()", "translatez()", "translate3d()", "turn",
163 "unicode-bidi", "unicode-range", "unset", "<uri>", "url()", "<user-ident>",
163 "unicode-bidi", "unicode-range", "unset", "<uri>", "url()", "<user-ident>",
164 ":valid", "::value", "var()", "vertical-align", "vh", "@viewport",
164 ":valid", "::value", "var()", "vertical-align", "vh", "@viewport",
165 "visibility", ":visited", "vmax", "vmin", "vw", "white-space", "widows",
165 "visibility", ":visited", "vmax", "vmin", "vw", "white-space", "widows",
166 "width", "will-change", "word-break", "word-spacing", "word-wrap",
166 "width", "will-change", "word-break", "word-spacing", "word-wrap",
167 "writing-mode", "z-index",
167 "writing-mode", "z-index",
168
168
169 ]
169 ]
170
170
171 webkit_prefixed_styles = [
171 webkit_prefixed_styles = [
172 # Webkit-prefixed styles
172 # Webkit-prefixed styles
173 # https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Webkit_Extensions
173 # https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Webkit_Extensions
174 "-webkit-animation", "-webkit-animation-delay", "-webkit-animation-direction",
174 "-webkit-animation", "-webkit-animation-delay", "-webkit-animation-direction",
175 "-webkit-animation-duration", "-webkit-animation-fill-mode",
175 "-webkit-animation-duration", "-webkit-animation-fill-mode",
176 "-webkit-animation-iteration-count", "-webkit-animation-name",
176 "-webkit-animation-iteration-count", "-webkit-animation-name",
177 "-webkit-animation-play-state", "-webkit-animation-timing-function",
177 "-webkit-animation-play-state", "-webkit-animation-timing-function",
178 "-webkit-backface-visibility", "-webkit-border-image", "-webkit-column-count",
178 "-webkit-backface-visibility", "-webkit-border-image", "-webkit-column-count",
179 "-webkit-column-gap", "-webkit-column-width", "-webkit-column-rule",
179 "-webkit-column-gap", "-webkit-column-width", "-webkit-column-rule",
180 "-webkit-column-rule-width", "-webkit-column-rule-style",
180 "-webkit-column-rule-width", "-webkit-column-rule-style",
181 "-webkit-column-rule-color", "-webkit-columns", "-webkit-column-span",
181 "-webkit-column-rule-color", "-webkit-columns", "-webkit-column-span",
182 "-webkit-font-feature-settings", "-webkit-font-kerning",
182 "-webkit-font-feature-settings", "-webkit-font-kerning",
183 "-webkit-font-size-delta", "-webkit-font-variant-ligatures",
183 "-webkit-font-size-delta", "-webkit-font-variant-ligatures",
184 "-webkit-grid-column", "-webkit-grid-row", "-webkit-hyphens", "-webkit-mask",
184 "-webkit-grid-column", "-webkit-grid-row", "-webkit-hyphens", "-webkit-mask",
185 "-webkit-mask-clip", "-webkit-mask-composite", "-webkit-mask-image",
185 "-webkit-mask-clip", "-webkit-mask-composite", "-webkit-mask-image",
186 "-webkit-mask-origin", "-webkit-mask-position", "-webkit-mask-repeat",
186 "-webkit-mask-origin", "-webkit-mask-position", "-webkit-mask-repeat",
187 "-webkit-mask-size", "-webkit-perspective", "-webkit-perspective-origin",
187 "-webkit-mask-size", "-webkit-perspective", "-webkit-perspective-origin",
188 "-webkit-region-fragment", "-webkit-shape-outside", "-webkit-text-emphasis",
188 "-webkit-region-fragment", "-webkit-shape-outside", "-webkit-text-emphasis",
189 "-webkit-text-emphasis-color", "-webkit-text-emphasis-position",
189 "-webkit-text-emphasis-color", "-webkit-text-emphasis-position",
190 "-webkit-text-emphasis-style", "-webkit-transform", "-webkit-transform-origin",
190 "-webkit-text-emphasis-style", "-webkit-transform", "-webkit-transform-origin",
191 "-webkit-transform-style", "-webkit-transition", "-webkit-transition-delay",
191 "-webkit-transform-style", "-webkit-transition", "-webkit-transition-delay",
192 "-webkit-transition-duration", "-webkit-transition-property",
192 "-webkit-transition-duration", "-webkit-transition-property",
193 "-webkit-transition-timing-function", "-epub-word-break", "-epub-writing-mode",
193 "-webkit-transition-timing-function", "-epub-word-break", "-epub-writing-mode",
194 # WebKit-prefixed properties with an unprefixed counterpart
194 # WebKit-prefixed properties with an unprefixed counterpart
195 "-webkit-background-clip", "-webkit-background-origin",
195 "-webkit-background-clip", "-webkit-background-origin",
196 "-webkit-background-size", "-webkit-border-bottom-left-radius",
196 "-webkit-background-size", "-webkit-border-bottom-left-radius",
197 "-webkit-border-bottom-right-radius", "-webkit-border-radius",
197 "-webkit-border-bottom-right-radius", "-webkit-border-radius",
198 "-webkit-border-top-left-radius", "-webkit-border-top-right-radius",
198 "-webkit-border-top-left-radius", "-webkit-border-top-right-radius",
199 "-webkit-box-sizing", "-epub-caption-side", "-webkit-opacity",
199 "-webkit-box-sizing", "-epub-caption-side", "-webkit-opacity",
200 "-epub-text-transform",
200 "-epub-text-transform",
201 ]
201 ]
202
202
203 mozilla_prefixed_styles = [
203 mozilla_prefixed_styles = [
204 "-moz-column-count", "-moz-column-fill", "-moz-column-gap",
204 "-moz-column-count", "-moz-column-fill", "-moz-column-gap",
205 "-moz-column-width", "-moz-column-rule", "-moz-column-rule-width",
205 "-moz-column-width", "-moz-column-rule", "-moz-column-rule-width",
206 "-moz-column-rule-style", "-moz-column-rule-color",
206 "-moz-column-rule-style", "-moz-column-rule-color",
207 "-moz-font-feature-settings", "-moz-font-language-override", "-moz-hyphens",
207 "-moz-font-feature-settings", "-moz-font-language-override", "-moz-hyphens",
208 "-moz-text-align-last", "-moz-text-decoration-color",
208 "-moz-text-align-last", "-moz-text-decoration-color",
209 "-moz-text-decoration-line", "-moz-text-decoration-style",
209 "-moz-text-decoration-line", "-moz-text-decoration-style",
210 ]
210 ]
211
211
212 all_prefixed_styles = [
212 all_prefixed_styles = [
213 # From http://peter.sh/experiments/vendor-prefixed-css-property-overview/
213 # From http://peter.sh/experiments/vendor-prefixed-css-property-overview/
214 "-ms-accelerator", "-webkit-app-region", "-webkit-appearance",
214 "-ms-accelerator", "-webkit-app-region", "-webkit-appearance",
215 "-webkit-appearance", "-moz-appearance", "-webkit-aspect-ratio",
215 "-webkit-appearance", "-moz-appearance", "-webkit-aspect-ratio",
216 "-webkit-backdrop-filter", "backface-visibility",
216 "-webkit-backdrop-filter", "backface-visibility",
217 "-webkit-backface-visibility", "backface-visibility", "backface-visibility",
217 "-webkit-backface-visibility", "backface-visibility", "backface-visibility",
218 "-webkit-background-composite", "-webkit-background-composite", "-moz-binding",
218 "-webkit-background-composite", "-webkit-background-composite", "-moz-binding",
219 "-ms-block-progression", "-webkit-border-after", "-webkit-border-after",
219 "-ms-block-progression", "-webkit-border-after", "-webkit-border-after",
220 "-webkit-border-after-color", "-webkit-border-after-color",
220 "-webkit-border-after-color", "-webkit-border-after-color",
221 "-webkit-border-after-style", "-webkit-border-after-style",
221 "-webkit-border-after-style", "-webkit-border-after-style",
222 "-webkit-border-after-width", "-webkit-border-after-width",
222 "-webkit-border-after-width", "-webkit-border-after-width",
223 "-webkit-border-before", "-webkit-border-before",
223 "-webkit-border-before", "-webkit-border-before",
224 "-webkit-border-before-color", "-webkit-border-before-color",
224 "-webkit-border-before-color", "-webkit-border-before-color",
225 "-webkit-border-before-style", "-webkit-border-before-style",
225 "-webkit-border-before-style", "-webkit-border-before-style",
226 "-webkit-border-before-width", "-webkit-border-before-width",
226 "-webkit-border-before-width", "-webkit-border-before-width",
227 "-moz-border-bottom-colors", "-webkit-border-end", "-webkit-border-end",
227 "-moz-border-bottom-colors", "-webkit-border-end", "-webkit-border-end",
228 "-moz-border-end", "-webkit-border-end-color", "-webkit-border-end-color",
228 "-moz-border-end", "-webkit-border-end-color", "-webkit-border-end-color",
229 "-moz-border-end-color", "-webkit-border-end-style",
229 "-moz-border-end-color", "-webkit-border-end-style",
230 "-webkit-border-end-style", "-moz-border-end-style",
230 "-webkit-border-end-style", "-moz-border-end-style",
231 "-webkit-border-end-width", "-webkit-border-end-width",
231 "-webkit-border-end-width", "-webkit-border-end-width",
232 "-moz-border-end-width", "-webkit-border-fit",
232 "-moz-border-end-width", "-webkit-border-fit",
233 "-webkit-border-horizontal-spacing", "-webkit-border-horizontal-spacing",
233 "-webkit-border-horizontal-spacing", "-webkit-border-horizontal-spacing",
234 "-moz-border-left-colors", "-moz-border-right-colors", "-webkit-border-start",
234 "-moz-border-left-colors", "-moz-border-right-colors", "-webkit-border-start",
235 "-webkit-border-start", "-moz-border-start", "-webkit-border-start-color",
235 "-webkit-border-start", "-moz-border-start", "-webkit-border-start-color",
236 "-webkit-border-start-color", "-moz-border-start-color",
236 "-webkit-border-start-color", "-moz-border-start-color",
237 "-webkit-border-start-style", "-webkit-border-start-style",
237 "-webkit-border-start-style", "-webkit-border-start-style",
238 "-moz-border-start-style", "-webkit-border-start-width",
238 "-moz-border-start-style", "-webkit-border-start-width",
239 "-webkit-border-start-width", "-moz-border-start-width",
239 "-webkit-border-start-width", "-moz-border-start-width",
240 "-moz-border-top-colors", "-webkit-border-vertical-spacing",
240 "-moz-border-top-colors", "-webkit-border-vertical-spacing",
241 "-webkit-border-vertical-spacing", "-webkit-box-align", "-webkit-box-align",
241 "-webkit-border-vertical-spacing", "-webkit-box-align", "-webkit-box-align",
242 "-moz-box-align", "-webkit-box-decoration-break",
242 "-moz-box-align", "-webkit-box-decoration-break",
243 "-webkit-box-decoration-break", "box-decoration-break",
243 "-webkit-box-decoration-break", "box-decoration-break",
244 "-webkit-box-direction", "-webkit-box-direction", "-moz-box-direction",
244 "-webkit-box-direction", "-webkit-box-direction", "-moz-box-direction",
245 "-webkit-box-flex", "-webkit-box-flex", "-moz-box-flex",
245 "-webkit-box-flex", "-webkit-box-flex", "-moz-box-flex",
246 "-webkit-box-flex-group", "-webkit-box-flex-group", "-webkit-box-lines",
246 "-webkit-box-flex-group", "-webkit-box-flex-group", "-webkit-box-lines",
247 "-webkit-box-lines", "-webkit-box-ordinal-group", "-webkit-box-ordinal-group",
247 "-webkit-box-lines", "-webkit-box-ordinal-group", "-webkit-box-ordinal-group",
248 "-moz-box-ordinal-group", "-webkit-box-orient", "-webkit-box-orient",
248 "-moz-box-ordinal-group", "-webkit-box-orient", "-webkit-box-orient",
249 "-moz-box-orient", "-webkit-box-pack", "-webkit-box-pack", "-moz-box-pack",
249 "-moz-box-orient", "-webkit-box-pack", "-webkit-box-pack", "-moz-box-pack",
250 "-webkit-box-reflect", "-webkit-box-reflect", "clip-path", "-webkit-clip-path",
250 "-webkit-box-reflect", "-webkit-box-reflect", "clip-path", "-webkit-clip-path",
251 "clip-path", "clip-path", "-webkit-color-correction", "-webkit-column-axis",
251 "clip-path", "clip-path", "-webkit-color-correction", "-webkit-column-axis",
252 "-webkit-column-break-after", "-webkit-column-break-after",
252 "-webkit-column-break-after", "-webkit-column-break-after",
253 "-webkit-column-break-before", "-webkit-column-break-before",
253 "-webkit-column-break-before", "-webkit-column-break-before",
254 "-webkit-column-break-inside", "-webkit-column-break-inside",
254 "-webkit-column-break-inside", "-webkit-column-break-inside",
255 "-webkit-column-count", "column-count", "-moz-column-count", "column-count",
255 "-webkit-column-count", "column-count", "-moz-column-count", "column-count",
256 "column-fill", "column-fill", "-moz-column-fill", "column-fill",
256 "column-fill", "column-fill", "-moz-column-fill", "column-fill",
257 "-webkit-column-gap", "column-gap", "-moz-column-gap", "column-gap",
257 "-webkit-column-gap", "column-gap", "-moz-column-gap", "column-gap",
258 "-webkit-column-rule", "column-rule", "-moz-column-rule", "column-rule",
258 "-webkit-column-rule", "column-rule", "-moz-column-rule", "column-rule",
259 "-webkit-column-rule-color", "column-rule-color", "-moz-column-rule-color",
259 "-webkit-column-rule-color", "column-rule-color", "-moz-column-rule-color",
260 "column-rule-color", "-webkit-column-rule-style", "column-rule-style",
260 "column-rule-color", "-webkit-column-rule-style", "column-rule-style",
261 "-moz-column-rule-style", "column-rule-style", "-webkit-column-rule-width",
261 "-moz-column-rule-style", "column-rule-style", "-webkit-column-rule-width",
262 "column-rule-width", "-moz-column-rule-width", "column-rule-width",
262 "column-rule-width", "-moz-column-rule-width", "column-rule-width",
263 "-webkit-column-span", "column-span", "column-span", "-webkit-column-width",
263 "-webkit-column-span", "column-span", "column-span", "-webkit-column-width",
264 "column-width", "-moz-column-width", "column-width", "-webkit-columns",
264 "column-width", "-moz-column-width", "column-width", "-webkit-columns",
265 "columns", "-moz-columns", "columns", "-ms-content-zoom-chaining",
265 "columns", "-moz-columns", "columns", "-ms-content-zoom-chaining",
266 "-ms-content-zoom-limit", "-ms-content-zoom-limit-max",
266 "-ms-content-zoom-limit", "-ms-content-zoom-limit-max",
267 "-ms-content-zoom-limit-min", "-ms-content-zoom-snap",
267 "-ms-content-zoom-limit-min", "-ms-content-zoom-snap",
268 "-ms-content-zoom-snap-points", "-ms-content-zoom-snap-type",
268 "-ms-content-zoom-snap-points", "-ms-content-zoom-snap-type",
269 "-ms-content-zooming", "-moz-control-character-visibility",
269 "-ms-content-zooming", "-moz-control-character-visibility",
270 "-webkit-cursor-visibility", "-webkit-dashboard-region", "filter",
270 "-webkit-cursor-visibility", "-webkit-dashboard-region", "filter",
271 "-webkit-filter", "filter", "filter", "-ms-flex-align", "-ms-flex-item-align",
271 "-webkit-filter", "filter", "filter", "-ms-flex-align", "-ms-flex-item-align",
272 "-ms-flex-line-pack", "-ms-flex-negative", "-ms-flex-order", "-ms-flex-pack",
272 "-ms-flex-line-pack", "-ms-flex-negative", "-ms-flex-order", "-ms-flex-pack",
273 "-ms-flex-positive", "-ms-flex-preferred-size", "-moz-float-edge",
273 "-ms-flex-positive", "-ms-flex-preferred-size", "-moz-float-edge",
274 "-webkit-flow-from", "-ms-flow-from", "-webkit-flow-into", "-ms-flow-into",
274 "-webkit-flow-from", "-ms-flow-from", "-webkit-flow-into", "-ms-flow-into",
275 "-webkit-font-feature-settings", "-webkit-font-feature-settings",
275 "-webkit-font-feature-settings", "-webkit-font-feature-settings",
276 "font-feature-settings", "font-feature-settings", "font-kerning",
276 "font-feature-settings", "font-feature-settings", "font-kerning",
277 "-webkit-font-kerning", "font-kerning", "-webkit-font-size-delta",
277 "-webkit-font-kerning", "font-kerning", "-webkit-font-size-delta",
278 "-webkit-font-size-delta", "-webkit-font-smoothing", "-webkit-font-smoothing",
278 "-webkit-font-size-delta", "-webkit-font-smoothing", "-webkit-font-smoothing",
279 "font-variant-ligatures", "-webkit-font-variant-ligatures",
279 "font-variant-ligatures", "-webkit-font-variant-ligatures",
280 "font-variant-ligatures", "-moz-force-broken-image-icon", "grid",
280 "font-variant-ligatures", "-moz-force-broken-image-icon", "grid",
281 "-webkit-grid", "grid", "grid-area", "-webkit-grid-area", "grid-area",
281 "-webkit-grid", "grid", "grid-area", "-webkit-grid-area", "grid-area",
282 "grid-auto-columns", "-webkit-grid-auto-columns", "grid-auto-columns",
282 "grid-auto-columns", "-webkit-grid-auto-columns", "grid-auto-columns",
283 "grid-auto-flow", "-webkit-grid-auto-flow", "grid-auto-flow", "grid-auto-rows",
283 "grid-auto-flow", "-webkit-grid-auto-flow", "grid-auto-flow", "grid-auto-rows",
284 "-webkit-grid-auto-rows", "grid-auto-rows", "grid-column",
284 "-webkit-grid-auto-rows", "grid-auto-rows", "grid-column",
285 "-webkit-grid-column", "grid-column", "-ms-grid-column",
285 "-webkit-grid-column", "grid-column", "-ms-grid-column",
286 "-ms-grid-column-align", "grid-column-end", "-webkit-grid-column-end",
286 "-ms-grid-column-align", "grid-column-end", "-webkit-grid-column-end",
287 "grid-column-end", "-ms-grid-column-span", "grid-column-start",
287 "grid-column-end", "-ms-grid-column-span", "grid-column-start",
288 "-webkit-grid-column-start", "grid-column-start", "-ms-grid-columns",
288 "-webkit-grid-column-start", "grid-column-start", "-ms-grid-columns",
289 "grid-row", "-webkit-grid-row", "grid-row", "-ms-grid-row",
289 "grid-row", "-webkit-grid-row", "grid-row", "-ms-grid-row",
290 "-ms-grid-row-align", "grid-row-end", "-webkit-grid-row-end", "grid-row-end",
290 "-ms-grid-row-align", "grid-row-end", "-webkit-grid-row-end", "grid-row-end",
291 "-ms-grid-row-span", "grid-row-start", "-webkit-grid-row-start",
291 "-ms-grid-row-span", "grid-row-start", "-webkit-grid-row-start",
292 "grid-row-start", "-ms-grid-rows", "grid-template", "-webkit-grid-template",
292 "grid-row-start", "-ms-grid-rows", "grid-template", "-webkit-grid-template",
293 "grid-template", "grid-template-areas", "-webkit-grid-template-areas",
293 "grid-template", "grid-template-areas", "-webkit-grid-template-areas",
294 "grid-template-areas", "grid-template-columns",
294 "grid-template-areas", "grid-template-columns",
295 "-webkit-grid-template-columns", "grid-template-columns", "grid-template-rows",
295 "-webkit-grid-template-columns", "grid-template-columns", "grid-template-rows",
296 "-webkit-grid-template-rows", "grid-template-rows", "-ms-high-contrast-adjust",
296 "-webkit-grid-template-rows", "grid-template-rows", "-ms-high-contrast-adjust",
297 "-webkit-highlight", "-webkit-hyphenate-character",
297 "-webkit-highlight", "-webkit-hyphenate-character",
298 "-webkit-hyphenate-character", "-webkit-hyphenate-limit-after",
298 "-webkit-hyphenate-character", "-webkit-hyphenate-limit-after",
299 "-webkit-hyphenate-limit-before", "-ms-hyphenate-limit-chars",
299 "-webkit-hyphenate-limit-before", "-ms-hyphenate-limit-chars",
300 "-webkit-hyphenate-limit-lines", "-ms-hyphenate-limit-lines",
300 "-webkit-hyphenate-limit-lines", "-ms-hyphenate-limit-lines",
301 "-ms-hyphenate-limit-zone", "-webkit-hyphens", "-moz-hyphens", "-ms-hyphens",
301 "-ms-hyphenate-limit-zone", "-webkit-hyphens", "-moz-hyphens", "-ms-hyphens",
302 "-moz-image-region", "-ms-ime-align", "-webkit-initial-letter",
302 "-moz-image-region", "-ms-ime-align", "-webkit-initial-letter",
303 "-ms-interpolation-mode", "justify-self", "-webkit-justify-self",
303 "-ms-interpolation-mode", "justify-self", "-webkit-justify-self",
304 "-webkit-line-align", "-webkit-line-box-contain", "-webkit-line-box-contain",
304 "-webkit-line-align", "-webkit-line-box-contain", "-webkit-line-box-contain",
305 "-webkit-line-break", "-webkit-line-break", "line-break", "-webkit-line-clamp",
305 "-webkit-line-break", "-webkit-line-break", "line-break", "-webkit-line-clamp",
306 "-webkit-line-clamp", "-webkit-line-grid", "-webkit-line-snap",
306 "-webkit-line-clamp", "-webkit-line-grid", "-webkit-line-snap",
307 "-webkit-locale", "-webkit-locale", "-webkit-logical-height",
307 "-webkit-locale", "-webkit-locale", "-webkit-logical-height",
308 "-webkit-logical-height", "-webkit-logical-width", "-webkit-logical-width",
308 "-webkit-logical-height", "-webkit-logical-width", "-webkit-logical-width",
309 "-webkit-margin-after", "-webkit-margin-after",
309 "-webkit-margin-after", "-webkit-margin-after",
310 "-webkit-margin-after-collapse", "-webkit-margin-after-collapse",
310 "-webkit-margin-after-collapse", "-webkit-margin-after-collapse",
311 "-webkit-margin-before", "-webkit-margin-before",
311 "-webkit-margin-before", "-webkit-margin-before",
312 "-webkit-margin-before-collapse", "-webkit-margin-before-collapse",
312 "-webkit-margin-before-collapse", "-webkit-margin-before-collapse",
313 "-webkit-margin-bottom-collapse", "-webkit-margin-bottom-collapse",
313 "-webkit-margin-bottom-collapse", "-webkit-margin-bottom-collapse",
314 "-webkit-margin-collapse", "-webkit-margin-collapse", "-webkit-margin-end",
314 "-webkit-margin-collapse", "-webkit-margin-collapse", "-webkit-margin-end",
315 "-webkit-margin-end", "-moz-margin-end", "-webkit-margin-start",
315 "-webkit-margin-end", "-moz-margin-end", "-webkit-margin-start",
316 "-webkit-margin-start", "-moz-margin-start", "-webkit-margin-top-collapse",
316 "-webkit-margin-start", "-moz-margin-start", "-webkit-margin-top-collapse",
317 "-webkit-margin-top-collapse", "-webkit-marquee", "-webkit-marquee-direction",
317 "-webkit-margin-top-collapse", "-webkit-marquee", "-webkit-marquee-direction",
318 "-webkit-marquee-increment", "-webkit-marquee-repetition",
318 "-webkit-marquee-increment", "-webkit-marquee-repetition",
319 "-webkit-marquee-speed", "-webkit-marquee-style", "mask", "-webkit-mask",
319 "-webkit-marquee-speed", "-webkit-marquee-style", "mask", "-webkit-mask",
320 "mask", "-webkit-mask-box-image", "-webkit-mask-box-image",
320 "mask", "-webkit-mask-box-image", "-webkit-mask-box-image",
321 "-webkit-mask-box-image-outset", "-webkit-mask-box-image-outset",
321 "-webkit-mask-box-image-outset", "-webkit-mask-box-image-outset",
322 "-webkit-mask-box-image-repeat", "-webkit-mask-box-image-repeat",
322 "-webkit-mask-box-image-repeat", "-webkit-mask-box-image-repeat",
323 "-webkit-mask-box-image-slice", "-webkit-mask-box-image-slice",
323 "-webkit-mask-box-image-slice", "-webkit-mask-box-image-slice",
324 "-webkit-mask-box-image-source", "-webkit-mask-box-image-source",
324 "-webkit-mask-box-image-source", "-webkit-mask-box-image-source",
325 "-webkit-mask-box-image-width", "-webkit-mask-box-image-width",
325 "-webkit-mask-box-image-width", "-webkit-mask-box-image-width",
326 "-webkit-mask-clip", "-webkit-mask-clip", "-webkit-mask-composite",
326 "-webkit-mask-clip", "-webkit-mask-clip", "-webkit-mask-composite",
327 "-webkit-mask-composite", "-webkit-mask-image", "-webkit-mask-image",
327 "-webkit-mask-composite", "-webkit-mask-image", "-webkit-mask-image",
328 "-webkit-mask-origin", "-webkit-mask-origin", "-webkit-mask-position",
328 "-webkit-mask-origin", "-webkit-mask-origin", "-webkit-mask-position",
329 "-webkit-mask-position", "-webkit-mask-position-x", "-webkit-mask-position-x",
329 "-webkit-mask-position", "-webkit-mask-position-x", "-webkit-mask-position-x",
330 "-webkit-mask-position-y", "-webkit-mask-position-y", "-webkit-mask-repeat",
330 "-webkit-mask-position-y", "-webkit-mask-position-y", "-webkit-mask-repeat",
331 "-webkit-mask-repeat", "-webkit-mask-repeat-x", "-webkit-mask-repeat-x",
331 "-webkit-mask-repeat", "-webkit-mask-repeat-x", "-webkit-mask-repeat-x",
332 "-webkit-mask-repeat-y", "-webkit-mask-repeat-y", "-webkit-mask-size",
332 "-webkit-mask-repeat-y", "-webkit-mask-repeat-y", "-webkit-mask-size",
333 "-webkit-mask-size", "mask-source-type", "-webkit-mask-source-type",
333 "-webkit-mask-size", "mask-source-type", "-webkit-mask-source-type",
334 "-moz-math-display", "-moz-math-variant", "-webkit-max-logical-height",
334 "-moz-math-display", "-moz-math-variant", "-webkit-max-logical-height",
335 "-webkit-max-logical-height", "-webkit-max-logical-width",
335 "-webkit-max-logical-height", "-webkit-max-logical-width",
336 "-webkit-max-logical-width", "-webkit-min-logical-height",
336 "-webkit-max-logical-width", "-webkit-min-logical-height",
337 "-webkit-min-logical-height", "-webkit-min-logical-width",
337 "-webkit-min-logical-height", "-webkit-min-logical-width",
338 "-webkit-min-logical-width", "-webkit-nbsp-mode", "-moz-orient",
338 "-webkit-min-logical-width", "-webkit-nbsp-mode", "-moz-orient",
339 "-moz-osx-font-smoothing", "-moz-outline-radius",
339 "-moz-osx-font-smoothing", "-moz-outline-radius",
340 "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright",
340 "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright",
341 "-moz-outline-radius-topleft", "-moz-outline-radius-topright",
341 "-moz-outline-radius-topleft", "-moz-outline-radius-topright",
342 "-webkit-overflow-scrolling", "-ms-overflow-style", "-webkit-padding-after",
342 "-webkit-overflow-scrolling", "-ms-overflow-style", "-webkit-padding-after",
343 "-webkit-padding-after", "-webkit-padding-before", "-webkit-padding-before",
343 "-webkit-padding-after", "-webkit-padding-before", "-webkit-padding-before",
344 "-webkit-padding-end", "-webkit-padding-end", "-moz-padding-end",
344 "-webkit-padding-end", "-webkit-padding-end", "-moz-padding-end",
345 "-webkit-padding-start", "-webkit-padding-start", "-moz-padding-start",
345 "-webkit-padding-start", "-webkit-padding-start", "-moz-padding-start",
346 "perspective", "-webkit-perspective", "perspective", "perspective",
346 "perspective", "-webkit-perspective", "perspective", "perspective",
347 "perspective-origin", "-webkit-perspective-origin", "perspective-origin",
347 "perspective-origin", "-webkit-perspective-origin", "perspective-origin",
348 "perspective-origin", "-webkit-perspective-origin-x",
348 "perspective-origin", "-webkit-perspective-origin-x",
349 "-webkit-perspective-origin-x", "perspective-origin-x",
349 "-webkit-perspective-origin-x", "perspective-origin-x",
350 "-webkit-perspective-origin-y", "-webkit-perspective-origin-y",
350 "-webkit-perspective-origin-y", "-webkit-perspective-origin-y",
351 "perspective-origin-y", "-webkit-print-color-adjust",
351 "perspective-origin-y", "-webkit-print-color-adjust",
352 "-webkit-print-color-adjust", "-webkit-region-break-after",
352 "-webkit-print-color-adjust", "-webkit-region-break-after",
353 "-webkit-region-break-before", "-webkit-region-break-inside",
353 "-webkit-region-break-before", "-webkit-region-break-inside",
354 "-webkit-region-fragment", "-webkit-rtl-ordering", "-webkit-rtl-ordering",
354 "-webkit-region-fragment", "-webkit-rtl-ordering", "-webkit-rtl-ordering",
355 "-webkit-ruby-position", "-webkit-ruby-position", "ruby-position",
355 "-webkit-ruby-position", "-webkit-ruby-position", "ruby-position",
356 "-moz-script-level", "-moz-script-min-size", "-moz-script-size-multiplier",
356 "-moz-script-level", "-moz-script-min-size", "-moz-script-size-multiplier",
357 "-ms-scroll-chaining", "-ms-scroll-limit", "-ms-scroll-limit-x-max",
357 "-ms-scroll-chaining", "-ms-scroll-limit", "-ms-scroll-limit-x-max",
358 "-ms-scroll-limit-x-min", "-ms-scroll-limit-y-max", "-ms-scroll-limit-y-min",
358 "-ms-scroll-limit-x-min", "-ms-scroll-limit-y-max", "-ms-scroll-limit-y-min",
359 "-ms-scroll-rails", "-webkit-scroll-snap-coordinate",
359 "-ms-scroll-rails", "-webkit-scroll-snap-coordinate",
360 "-webkit-scroll-snap-destination", "-webkit-scroll-snap-points-x",
360 "-webkit-scroll-snap-destination", "-webkit-scroll-snap-points-x",
361 "-ms-scroll-snap-points-x", "-webkit-scroll-snap-points-y",
361 "-ms-scroll-snap-points-x", "-webkit-scroll-snap-points-y",
362 "-ms-scroll-snap-points-y", "-webkit-scroll-snap-type", "-ms-scroll-snap-type",
362 "-ms-scroll-snap-points-y", "-webkit-scroll-snap-type", "-ms-scroll-snap-type",
363 "-ms-scroll-snap-x", "-ms-scroll-snap-y", "-ms-scroll-translation",
363 "-ms-scroll-snap-x", "-ms-scroll-snap-y", "-ms-scroll-translation",
364 "-ms-scrollbar-3dlight-color", "shape-image-threshold",
364 "-ms-scrollbar-3dlight-color", "shape-image-threshold",
365 "-webkit-shape-image-threshold", "shape-margin", "-webkit-shape-margin",
365 "-webkit-shape-image-threshold", "shape-margin", "-webkit-shape-margin",
366 "shape-outside", "-webkit-shape-outside", "-moz-stack-sizing", "tab-size",
366 "shape-outside", "-webkit-shape-outside", "-moz-stack-sizing", "tab-size",
367 "tab-size", "-moz-tab-size", "-webkit-tap-highlight-color",
367 "tab-size", "-moz-tab-size", "-webkit-tap-highlight-color",
368 "-webkit-tap-highlight-color", "text-align-last", "-webkit-text-align-last",
368 "-webkit-tap-highlight-color", "text-align-last", "-webkit-text-align-last",
369 "-moz-text-align-last", "text-align-last", "-webkit-text-combine",
369 "-moz-text-align-last", "text-align-last", "-webkit-text-combine",
370 "-webkit-text-combine", "-ms-text-combine-horizontal", "text-decoration-color",
370 "-webkit-text-combine", "-ms-text-combine-horizontal", "text-decoration-color",
371 "-webkit-text-decoration-color", "text-decoration-color",
371 "-webkit-text-decoration-color", "text-decoration-color",
372 "text-decoration-color", "text-decoration-line",
372 "text-decoration-color", "text-decoration-line",
373 "-webkit-text-decoration-line", "text-decoration-line",
373 "-webkit-text-decoration-line", "text-decoration-line",
374 "-webkit-text-decoration-skip", "text-decoration-style",
374 "-webkit-text-decoration-skip", "text-decoration-style",
375 "-webkit-text-decoration-style", "text-decoration-style",
375 "-webkit-text-decoration-style", "text-decoration-style",
376 "-webkit-text-decorations-in-effect", "-webkit-text-decorations-in-effect",
376 "-webkit-text-decorations-in-effect", "-webkit-text-decorations-in-effect",
377 "-webkit-text-emphasis", "text-emphasis", "-webkit-text-emphasis-color",
377 "-webkit-text-emphasis", "text-emphasis", "-webkit-text-emphasis-color",
378 "text-emphasis-color", "-webkit-text-emphasis-position",
378 "text-emphasis-color", "-webkit-text-emphasis-position",
379 "text-emphasis-position", "-webkit-text-emphasis-style", "text-emphasis-style",
379 "text-emphasis-position", "-webkit-text-emphasis-style", "text-emphasis-style",
380 "-webkit-text-fill-color", "-webkit-text-fill-color", "text-justify",
380 "-webkit-text-fill-color", "-webkit-text-fill-color", "text-justify",
381 "-webkit-text-justify", "text-justify", "-webkit-text-orientation",
381 "-webkit-text-justify", "text-justify", "-webkit-text-orientation",
382 "-webkit-text-orientation", "text-orientation", "-webkit-text-security",
382 "-webkit-text-orientation", "text-orientation", "-webkit-text-security",
383 "-webkit-text-security", "-webkit-text-size-adjust", "-moz-text-size-adjust",
383 "-webkit-text-security", "-webkit-text-size-adjust", "-moz-text-size-adjust",
384 "-ms-text-size-adjust", "-webkit-text-stroke", "-webkit-text-stroke",
384 "-ms-text-size-adjust", "-webkit-text-stroke", "-webkit-text-stroke",
385 "-webkit-text-stroke-color", "-webkit-text-stroke-color",
385 "-webkit-text-stroke-color", "-webkit-text-stroke-color",
386 "-webkit-text-stroke-width", "-webkit-text-stroke-width",
386 "-webkit-text-stroke-width", "-webkit-text-stroke-width",
387 "text-underline-position", "-webkit-text-underline-position",
387 "text-underline-position", "-webkit-text-underline-position",
388 "text-underline-position", "-webkit-touch-callout", "-ms-touch-select",
388 "text-underline-position", "-webkit-touch-callout", "-ms-touch-select",
389 "transform", "-webkit-transform", "transform", "transform", "transform-origin",
389 "transform", "-webkit-transform", "transform", "transform", "transform-origin",
390 "-webkit-transform-origin", "transform-origin", "transform-origin",
390 "-webkit-transform-origin", "transform-origin", "transform-origin",
391 "-webkit-transform-origin-x", "-webkit-transform-origin-x",
391 "-webkit-transform-origin-x", "-webkit-transform-origin-x",
392 "transform-origin-x", "-webkit-transform-origin-y",
392 "transform-origin-x", "-webkit-transform-origin-y",
393 "-webkit-transform-origin-y", "transform-origin-y",
393 "-webkit-transform-origin-y", "transform-origin-y",
394 "-webkit-transform-origin-z", "-webkit-transform-origin-z",
394 "-webkit-transform-origin-z", "-webkit-transform-origin-z",
395 "transform-origin-z", "transform-style", "-webkit-transform-style",
395 "transform-origin-z", "transform-style", "-webkit-transform-style",
396 "transform-style", "transform-style", "-webkit-user-drag", "-webkit-user-drag",
396 "transform-style", "transform-style", "-webkit-user-drag", "-webkit-user-drag",
397 "-moz-user-focus", "-moz-user-input", "-webkit-user-modify",
397 "-moz-user-focus", "-moz-user-input", "-webkit-user-modify",
398 "-webkit-user-modify", "-moz-user-modify", "-webkit-user-select",
398 "-webkit-user-modify", "-moz-user-modify", "-webkit-user-select",
399 "-webkit-user-select", "-moz-user-select", "-ms-user-select",
399 "-webkit-user-select", "-moz-user-select", "-ms-user-select",
400 "-moz-window-dragging", "-moz-window-shadow", "-ms-wrap-flow",
400 "-moz-window-dragging", "-moz-window-shadow", "-ms-wrap-flow",
401 "-ms-wrap-margin", "-ms-wrap-through", "writing-mode", "-webkit-writing-mode",
401 "-ms-wrap-margin", "-ms-wrap-through", "writing-mode", "-webkit-writing-mode",
402 "writing-mode", "writing-mode",
402 "writing-mode", "writing-mode",
403 ]
403 ]
404
404
405 all_styles = standard_styles + all_prefixed_styles No newline at end of file
405 all_styles = standard_styles + all_prefixed_styles
@@ -1,77 +1,62 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2019 RhodeCode GmbH
3 # Copyright (C) 2010-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import re
22
23 import markdown
21 import markdown
24
22
25 from mdx_gfm import GithubFlavoredMarkdownExtension # pragma: no cover
23 from mdx_gfm import GithubFlavoredMarkdownExtension # pragma: no cover
26
24
27
25
28 class FlavoredCheckboxPostprocessor(markdown.postprocessors.Postprocessor):
29 """
30 Adds `flavored_checkbox_list` class to list of checkboxes
31 """
32
33 pattern = re.compile(r'^([*-]) \[([ x])\]')
34
35 def run(self, html):
36 before = '<ul>\n<li><input type="checkbox"'
37 after = '<ul class="flavored_checkbox_list">\n<li><input type="checkbox"'
38 return html.replace(before, after)
39
40
41 # Global Vars
26 # Global Vars
42 URLIZE_RE = '(%s)' % '|'.join([
27 URLIZE_RE = '(%s)' % '|'.join([
43 r'<(?:f|ht)tps?://[^>]*>',
28 r'<(?:f|ht)tps?://[^>]*>',
44 r'\b(?:f|ht)tps?://[^)<>\s]+[^.,)<>\s]',
29 r'\b(?:f|ht)tps?://[^)<>\s]+[^.,)<>\s]',
45 r'\bwww\.[^)<>\s]+[^.,)<>\s]',
30 r'\bwww\.[^)<>\s]+[^.,)<>\s]',
46 r'[^(<\s]+\.(?:com|net|org)\b',
31 r'[^(<\s]+\.(?:com|net|org)\b',
47 ])
32 ])
48
33
49
34
50 class UrlizePattern(markdown.inlinepatterns.Pattern):
35 class UrlizePattern(markdown.inlinepatterns.Pattern):
51 """ Return a link Element given an autolink (`http://example/com`). """
36 """ Return a link Element given an autolink (`http://example/com`). """
52 def handleMatch(self, m):
37 def handleMatch(self, m):
53 url = m.group(2)
38 url = m.group(2)
54
39
55 if url.startswith('<'):
40 if url.startswith('<'):
56 url = url[1:-1]
41 url = url[1:-1]
57
42
58 text = url
43 text = url
59
44
60 if not url.split('://')[0] in ('http','https','ftp'):
45 if not url.split('://')[0] in ('http','https','ftp'):
61 if '@' in url and not '/' in url:
46 if '@' in url and not '/' in url:
62 url = 'mailto:' + url
47 url = 'mailto:' + url
63 else:
48 else:
64 url = 'http://' + url
49 url = 'http://' + url
65
50
66 el = markdown.util.etree.Element("a")
51 el = markdown.util.etree.Element("a")
67 el.set('href', url)
52 el.set('href', url)
68 el.text = markdown.util.AtomicString(text)
53 el.text = markdown.util.AtomicString(text)
69 return el
54 return el
70
55
71
56
72 class UrlizeExtension(markdown.Extension):
57 class UrlizeExtension(markdown.Extension):
73 """ Urlize Extension for Python-Markdown. """
58 """ Urlize Extension for Python-Markdown. """
74
59
75 def extendMarkdown(self, md, md_globals):
60 def extendMarkdown(self, md, md_globals):
76 """ Replace autolink with UrlizePattern """
61 """ Replace autolink with UrlizePattern """
77 md.inlinePatterns['autolink'] = UrlizePattern(URLIZE_RE, md)
62 md.inlinePatterns['autolink'] = UrlizePattern(URLIZE_RE, md)
General Comments 0
You need to be logged in to leave comments. Login now