diff --git a/NEWS b/NEWS index 55448f41..af32f72f 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier + nowrap in td + clear in br + align in caption, table, img and hr + + type in ul, ol and li ! target attribute in a tag supported, use %Attr.AllowedFrameTargets to enable ! CSS property white-space now allows nowrap (supported in all modern diff --git a/docs/dev-progress.html b/docs/dev-progress.html index f55dbb02..8d245308 100644 --- a/docs/dev-progress.html +++ b/docs/dev-progress.html @@ -262,7 +262,7 @@ Mozilla on inside and needs -moz-outline, no IE support. -Transform, target milestone 1.6.1/1.7 +Transform alignCAPTION'caption-side' for top/bottom, 'text-align' for left/right IMGSee specimens/html-align-to-css.html TABLE @@ -286,9 +286,9 @@ Mozilla on inside and needs -moz-outline, no IE support. sizeHRNear-equiv 'height', needs px suffix if original was pixels srcIMGRequired, insert blank or default img if not set startOLPoorly supported 'counter-reset', allowed in loose, dropped in strict -typeLIEquivalent style 'list-style-type', different allowed values though. (needs testing) - OL - UL +typeLIEquivalent style 'list-style-type', different allowed values though. (needs testing) + OL + UL valueLIPoorly supported 'counter-reset', allowed in loose, dropped in strict vspaceIMGNear-equiv styles 'margin-left' and 'margin-right', needs px suffix, see hspace widthHRNear-equiv style 'width', needs px suffix if original was pixels diff --git a/library/HTMLPurifier/HTMLModule/TransformToStrict.php b/library/HTMLPurifier/HTMLModule/TransformToStrict.php index ce621b50..0b6c8370 100644 --- a/library/HTMLPurifier/HTMLModule/TransformToStrict.php +++ b/library/HTMLPurifier/HTMLModule/TransformToStrict.php @@ -28,7 +28,7 @@ class HTMLPurifier_HTMLModule_TransformToStrict extends HTMLPurifier_HTMLModule // we're actually modifying these elements, not defining them var $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'blockquote', 'table', 'td', 'th', 'tr', 'img', 'a', 'hr', 'br', - 'caption'); + 'caption', 'ul', 'ol', 'li'); var $info_tag_transform = array( // placeholders, see constructor for definitions @@ -165,6 +165,28 @@ class HTMLPurifier_HTMLModule_TransformToStrict extends HTMLPurifier_HTMLModule 'right' => 'margin-left:auto;margin-right:0;text-align:right;' )); + $ul_types = array( + 'disc' => 'list-style-type:disc;', + 'square' => 'list-style-type:square;', + 'circle' => 'list-style-type:circle;' + ); + $ol_types = array( + '1' => 'list-style-type:decimal;', + 'i' => 'list-style-type:lower-roman;', + 'I' => 'list-style-type:upper-roman;', + 'a' => 'list-style-type:lower-alpha;', + 'A' => 'list-style-type:upper-alpha;' + ); + $li_types = $ul_types + $ol_types; + + $this->info['ul']->attr_transform_pre['type'] = + new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types); + $this->info['ol']->attr_transform_pre['type'] = + new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true); + $this->info['li']->attr_transform_pre['type'] = + new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true); + + } var $defines_child_def = true; diff --git a/smoketests/attrTransform.xml b/smoketests/attrTransform.xml index 12dbe52e..74500488 100644 --- a/smoketests/attrTransform.xml +++ b/smoketests/attrTransform.xml @@ -166,6 +166,17 @@ center]]> right]]> + +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +
  • 1
  • 2
  • ]]>
    +