mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-10 17:26:25 +02:00
Remove trailing whitespace.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@ -2,13 +2,13 @@
|
||||
|
||||
class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule_Tidy
|
||||
{
|
||||
|
||||
|
||||
public function makeFixes() {
|
||||
|
||||
|
||||
$r = array();
|
||||
|
||||
|
||||
// == deprecated tag transforms ===================================
|
||||
|
||||
|
||||
$r['font'] = new HTMLPurifier_TagTransform_Font();
|
||||
$r['menu'] = new HTMLPurifier_TagTransform_Simple('ul');
|
||||
$r['dir'] = new HTMLPurifier_TagTransform_Simple('ul');
|
||||
@ -16,10 +16,10 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
$r['u'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:underline;');
|
||||
$r['s'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:line-through;');
|
||||
$r['strike'] = new HTMLPurifier_TagTransform_Simple('span', 'text-decoration:line-through;');
|
||||
|
||||
|
||||
// == deprecated attribute transforms =============================
|
||||
|
||||
$r['caption@align'] =
|
||||
|
||||
$r['caption@align'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
|
||||
// we're following IE's behavior, not Firefox's, due
|
||||
// to the fact that no one supports caption-side:right,
|
||||
@ -30,7 +30,7 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'top' => 'caption-side:top;',
|
||||
'bottom' => 'caption-side:bottom;' // not supported by IE
|
||||
));
|
||||
|
||||
|
||||
// @align for img -------------------------------------------------
|
||||
$r['img@align'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
|
||||
@ -40,7 +40,7 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'middle' => 'vertical-align:middle;',
|
||||
'bottom' => 'vertical-align:baseline;',
|
||||
));
|
||||
|
||||
|
||||
// @align for table -----------------------------------------------
|
||||
$r['table@align'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
|
||||
@ -48,7 +48,7 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'center' => 'margin-left:auto;margin-right:auto;',
|
||||
'right' => 'float:right;'
|
||||
));
|
||||
|
||||
|
||||
// @align for hr -----------------------------------------------
|
||||
$r['hr@align'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
|
||||
@ -60,7 +60,7 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'center' => 'margin-left:auto;margin-right:auto;text-align:center;',
|
||||
'right' => 'margin-left:auto;margin-right:0;text-align:right;'
|
||||
));
|
||||
|
||||
|
||||
// @align for h1, h2, h3, h4, h5, h6, p, div ----------------------
|
||||
// {{{
|
||||
$align_lookup = array();
|
||||
@ -74,18 +74,18 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
$r['h5@align'] =
|
||||
$r['h6@align'] =
|
||||
$r['p@align'] =
|
||||
$r['div@align'] =
|
||||
$r['div@align'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('align', $align_lookup);
|
||||
|
||||
|
||||
// @bgcolor for table, tr, td, th ---------------------------------
|
||||
$r['table@bgcolor'] =
|
||||
$r['td@bgcolor'] =
|
||||
$r['th@bgcolor'] =
|
||||
new HTMLPurifier_AttrTransform_BgColor();
|
||||
|
||||
|
||||
// @border for img ------------------------------------------------
|
||||
$r['img@border'] = new HTMLPurifier_AttrTransform_Border();
|
||||
|
||||
|
||||
// @clear for br --------------------------------------------------
|
||||
$r['br@clear'] =
|
||||
new HTMLPurifier_AttrTransform_EnumToCSS('clear', array(
|
||||
@ -94,15 +94,15 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'all' => 'clear:both;',
|
||||
'none' => 'clear:none;',
|
||||
));
|
||||
|
||||
|
||||
// @height for td, th ---------------------------------------------
|
||||
$r['td@height'] =
|
||||
$r['td@height'] =
|
||||
$r['th@height'] =
|
||||
new HTMLPurifier_AttrTransform_Length('height');
|
||||
|
||||
|
||||
// @hspace for img ------------------------------------------------
|
||||
$r['img@hspace'] = new HTMLPurifier_AttrTransform_ImgSpace('hspace');
|
||||
|
||||
|
||||
// @noshade for hr ------------------------------------------------
|
||||
// this transformation is not precise but often good enough.
|
||||
// different browsers use different styles to designate noshade
|
||||
@ -111,18 +111,18 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
'noshade',
|
||||
'color:#808080;background-color:#808080;border:0;'
|
||||
);
|
||||
|
||||
|
||||
// @nowrap for td, th ---------------------------------------------
|
||||
$r['td@nowrap'] =
|
||||
$r['td@nowrap'] =
|
||||
$r['th@nowrap'] =
|
||||
new HTMLPurifier_AttrTransform_BoolToCSS(
|
||||
'nowrap',
|
||||
'white-space:nowrap;'
|
||||
);
|
||||
|
||||
|
||||
// @size for hr --------------------------------------------------
|
||||
$r['hr@size'] = new HTMLPurifier_AttrTransform_Length('size', 'height');
|
||||
|
||||
|
||||
// @type for li, ol, ul -------------------------------------------
|
||||
// {{{
|
||||
$ul_types = array(
|
||||
@ -139,22 +139,22 @@ class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HTMLModule
|
||||
);
|
||||
$li_types = $ul_types + $ol_types;
|
||||
// }}}
|
||||
|
||||
|
||||
$r['ul@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types);
|
||||
$r['ol@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true);
|
||||
$r['li@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true);
|
||||
|
||||
|
||||
// @vspace for img ------------------------------------------------
|
||||
$r['img@vspace'] = new HTMLPurifier_AttrTransform_ImgSpace('vspace');
|
||||
|
||||
|
||||
// @width for hr, td, th ------------------------------------------
|
||||
$r['td@width'] =
|
||||
$r['th@width'] =
|
||||
$r['th@width'] =
|
||||
$r['hr@width'] = new HTMLPurifier_AttrTransform_Length('width');
|
||||
|
||||
|
||||
return $r;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user