aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Name.php33
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Proprietary.php34
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Strict.php43
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php16
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTML.php26
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php179
6 files changed, 0 insertions, 331 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Name.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Name.php
deleted file mode 100644
index bb47bafd..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Name.php
+++ /dev/null
@@ -1,33 +0,0 @@
1<?php
2
3/**
4 * Name is deprecated, but allowed in strict doctypes, so onl
5 */
6class HTMLPurifier_HTMLModule_Tidy_Name extends HTMLPurifier_HTMLModule_Tidy
7{
8 /**
9 * @type string
10 */
11 public $name = 'Tidy_Name';
12
13 /**
14 * @type string
15 */
16 public $defaultLevel = 'heavy';
17
18 /**
19 * @return array
20 */
21 public function makeFixes()
22 {
23 $r = array();
24 // @name for img, a -----------------------------------------------
25 // Technically, it's allowed even on strict, so we allow authors to use
26 // it. However, it's deprecated in future versions of XHTML.
27 $r['img@name'] =
28 $r['a@name'] = new HTMLPurifier_AttrTransform_Name();
29 return $r;
30 }
31}
32
33// vim: et sw=4 sts=4
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Proprietary.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
deleted file mode 100644
index 638cb541..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
+++ /dev/null
@@ -1,34 +0,0 @@
1<?php
2
3class HTMLPurifier_HTMLModule_Tidy_Proprietary extends HTMLPurifier_HTMLModule_Tidy
4{
5
6 /**
7 * @type string
8 */
9 public $name = 'Tidy_Proprietary';
10
11 /**
12 * @type string
13 */
14 public $defaultLevel = 'light';
15
16 /**
17 * @return array
18 */
19 public function makeFixes()
20 {
21 $r = array();
22 $r['table@background'] = new HTMLPurifier_AttrTransform_Background();
23 $r['td@background'] = new HTMLPurifier_AttrTransform_Background();
24 $r['th@background'] = new HTMLPurifier_AttrTransform_Background();
25 $r['tr@background'] = new HTMLPurifier_AttrTransform_Background();
26 $r['thead@background'] = new HTMLPurifier_AttrTransform_Background();
27 $r['tfoot@background'] = new HTMLPurifier_AttrTransform_Background();
28 $r['tbody@background'] = new HTMLPurifier_AttrTransform_Background();
29 $r['table@height'] = new HTMLPurifier_AttrTransform_Length('height');
30 return $r;
31 }
32}
33
34// vim: et sw=4 sts=4
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Strict.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Strict.php
deleted file mode 100644
index ba3260e6..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Strict.php
+++ /dev/null
@@ -1,43 +0,0 @@
1<?php
2
3class HTMLPurifier_HTMLModule_Tidy_Strict extends HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4
4{
5 /**
6 * @type string
7 */
8 public $name = 'Tidy_Strict';
9
10 /**
11 * @type string
12 */
13 public $defaultLevel = 'light';
14
15 /**
16 * @return array
17 */
18 public function makeFixes()
19 {
20 $r = parent::makeFixes();
21 $r['blockquote#content_model_type'] = 'strictblockquote';
22 return $r;
23 }
24
25 /**
26 * @type bool
27 */
28 public $defines_child_def = true;
29
30 /**
31 * @param HTMLPurifier_ElementDef $def
32 * @return HTMLPurifier_ChildDef_StrictBlockquote
33 */
34 public function getChildDef($def)
35 {
36 if ($def->content_model_type != 'strictblockquote') {
37 return parent::getChildDef($def);
38 }
39 return new HTMLPurifier_ChildDef_StrictBlockquote($def->content_model);
40 }
41}
42
43// vim: et sw=4 sts=4
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php
deleted file mode 100644
index 79411d25..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php
+++ /dev/null
@@ -1,16 +0,0 @@
1<?php
2
3class HTMLPurifier_HTMLModule_Tidy_Transitional extends HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4
4{
5 /**
6 * @type string
7 */
8 public $name = 'Tidy_Transitional';
9
10 /**
11 * @type string
12 */
13 public $defaultLevel = 'heavy';
14}
15
16// vim: et sw=4 sts=4
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTML.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTML.php
deleted file mode 100644
index 935ad7f5..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTML.php
+++ /dev/null
@@ -1,26 +0,0 @@
1<?php
2
3class HTMLPurifier_HTMLModule_Tidy_XHTML extends HTMLPurifier_HTMLModule_Tidy
4{
5 /**
6 * @type string
7 */
8 public $name = 'Tidy_XHTML';
9
10 /**
11 * @type string
12 */
13 public $defaultLevel = 'medium';
14
15 /**
16 * @return array
17 */
18 public function makeFixes()
19 {
20 $r = array();
21 $r['@lang'] = new HTMLPurifier_AttrTransform_Lang();
22 return $r;
23 }
24}
25
26// vim: et sw=4 sts=4
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
deleted file mode 100644
index 17164fb6..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
+++ /dev/null
@@ -1,179 +0,0 @@
1<?php
2
3class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule_Tidy
4{
5
6 /**
7 * @return array
8 */
9 public function makeFixes()
10 {
11 $r = array();
12
13 // == deprecated tag transforms ===================================
14
15 $r['font'] = new HTMLPurifier_TagTransform_Font();
16 $r['menu'] = new HTMLPurifier_TagTransform_Simple('ul');
17 $r['dir'] = new HTMLPurifier_TagTransform_Simple('ul');
18 $r['center'] = new HTMLPurifier_TagTransform_Simple('div', 'text-align:center;');
19 $r['u'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:underline;');
20 $r['s'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:line-through;');
21 $r['strike'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:line-through;');
22
23 // == deprecated attribute transforms =============================
24
25 $r['caption@align'] =
26 new HTMLPurifier_AttrTransform_EnumToCSS(
27 'align',
28 array(
29 // we're following IE's behavior, not Firefox's, due
30 // to the fact that no one supports caption-side:right,
31 // W3C included (with CSS 2.1). This is a slightly
32 // unreasonable attribute!
33 'left' => 'text-align:left;',
34 'right' => 'text-align:right;',
35 'top' => 'caption-side:top;',
36 'bottom' => 'caption-side:bottom;' // not supported by IE
37 )
38 );
39
40 // @align for img -------------------------------------------------
41 $r['img@align'] =
42 new HTMLPurifier_AttrTransform_EnumToCSS(
43 'align',
44 array(
45 'left' => 'float:left;',
46 'right' => 'float:right;',
47 'top' => 'vertical-align:top;',
48 'middle' => 'vertical-align:middle;',
49 'bottom' => 'vertical-align:baseline;',
50 )
51 );
52
53 // @align for table -----------------------------------------------
54 $r['table@align'] =
55 new HTMLPurifier_AttrTransform_EnumToCSS(
56 'align',
57 array(
58 'left' => 'float:left;',
59 'center' => 'margin-left:auto;margin-right:auto;',
60 'right' => 'float:right;'
61 )
62 );
63
64 // @align for hr -----------------------------------------------
65 $r['hr@align'] =
66 new HTMLPurifier_AttrTransform_EnumToCSS(
67 'align',
68 array(
69 // we use both text-align and margin because these work
70 // for different browsers (IE and Firefox, respectively)
71 // and the melange makes for a pretty cross-compatible
72 // solution
73 'left' => 'margin-left:0;margin-right:auto;text-align:left;',
74 'center' => 'margin-left:auto;margin-right:auto;text-align:center;',
75 'right' => 'margin-left:auto;margin-right:0;text-align:right;'
76 )
77 );
78
79 // @align for h1, h2, h3, h4, h5, h6, p, div ----------------------
80 // {{{
81 $align_lookup = array();
82 $align_values = array('left', 'right', 'center', 'justify');
83 foreach ($align_values as $v) {
84 $align_lookup[$v] = "text-align:$v;";
85 }
86 // }}}
87 $r['h1@align'] =
88 $r['h2@align'] =
89 $r['h3@align'] =
90 $r['h4@align'] =
91 $r['h5@align'] =
92 $r['h6@align'] =
93 $r['p@align'] =
94 $r['div@align'] =
95 new HTMLPurifier_AttrTransform_EnumToCSS('align', $align_lookup);
96
97 // @bgcolor for table, tr, td, th ---------------------------------
98 $r['table@bgcolor'] =
99 $r['td@bgcolor'] =
100 $r['th@bgcolor'] =
101 new HTMLPurifier_AttrTransform_BgColor();
102
103 // @border for img ------------------------------------------------
104 $r['img@border'] = new HTMLPurifier_AttrTransform_Border();
105
106 // @clear for br --------------------------------------------------
107 $r['br@clear'] =
108 new HTMLPurifier_AttrTransform_EnumToCSS(
109 'clear',
110 array(
111 'left' => 'clear:left;',
112 'right' => 'clear:right;',
113 'all' => 'clear:both;',
114 'none' => 'clear:none;',
115 )
116 );
117
118 // @height for td, th ---------------------------------------------
119 $r['td@height'] =
120 $r['th@height'] =
121 new HTMLPurifier_AttrTransform_Length('height');
122
123 // @hspace for img ------------------------------------------------
124 $r['img@hspace'] = new HTMLPurifier_AttrTransform_ImgSpace('hspace');
125
126 // @noshade for hr ------------------------------------------------
127 // this transformation is not precise but often good enough.
128 // different browsers use different styles to designate noshade
129 $r['hr@noshade'] =
130 new HTMLPurifier_AttrTransform_BoolToCSS(
131 'noshade',
132 'color:#808080;background-color:#808080;border:0;'
133 );
134
135 // @nowrap for td, th ---------------------------------------------
136 $r['td@nowrap'] =
137 $r['th@nowrap'] =
138 new HTMLPurifier_AttrTransform_BoolToCSS(
139 'nowrap',
140 'white-space:nowrap;'
141 );
142
143 // @size for hr --------------------------------------------------
144 $r['hr@size'] = new HTMLPurifier_AttrTransform_Length('size', 'height');
145
146 // @type for li, ol, ul -------------------------------------------
147 // {{{
148 $ul_types = array(
149 'disc' => 'list-style-type:disc;',
150 'square' => 'list-style-type:square;',
151 'circle' => 'list-style-type:circle;'
152 );
153 $ol_types = array(
154 '1' => 'list-style-type:decimal;',
155 'i' => 'list-style-type:lower-roman;',
156 'I' => 'list-style-type:upper-roman;',
157 'a' => 'list-style-type:lower-alpha;',
158 'A' => 'list-style-type:upper-alpha;'
159 );
160 $li_types = $ul_types + $ol_types;
161 // }}}
162
163 $r['ul@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types);
164 $r['ol@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true);
165 $r['li@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true);
166
167 // @vspace for img ------------------------------------------------
168 $r['img@vspace'] = new HTMLPurifier_AttrTransform_ImgSpace('vspace');
169
170 // @width for hr, td, th ------------------------------------------
171 $r['td@width'] =
172 $r['th@width'] =
173 $r['hr@width'] = new HTMLPurifier_AttrTransform_Length('width');
174
175 return $r;
176 }
177}
178
179// vim: et sw=4 sts=4