diff --git a/NEWS b/NEWS
index 7365809a..9098e537 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
! Support for all deprecated attributes via attribute transformations
+ bgcolor in td, th, tr and table
+ border in img
+ + name in a and img
+ (incomplete)
1.5.1, unknown release date
diff --git a/docs/dev-progress.html b/docs/dev-progress.html
index 796d9343..9587739b 100644
--- a/docs/dev-progress.html
+++ b/docs/dev-progress.html
@@ -279,8 +279,8 @@ Mozilla on inside and needs -moz-outline, no IE support.
height | TD, TH | Near-equiv style 'height', needs px suffix if original was in pixels |
hspace | IMG | Near-equiv styles 'margin-top' and 'margin-bottom', needs px suffix |
lang | * | Copy value to xml:lang |
-name | IMG | Turn into ID |
- A | Turn into ID? (not deprecated, though in which specs?) |
+name | IMG | Turn into ID |
+ A | Turn into ID |
noshade | HR | Boolean, style 'border-style:solid;' |
nowrap | TD, TH | Boolean, style 'white-space:nowrap;' (not compat with IE5) |
size | HR | Near-equiv 'width', needs px suffix if original was pixels |
diff --git a/library/HTMLPurifier/AttrTransform/Name.php b/library/HTMLPurifier/AttrTransform/Name.php
new file mode 100644
index 00000000..0f815b69
--- /dev/null
+++ b/library/HTMLPurifier/AttrTransform/Name.php
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/library/HTMLPurifier/HTMLModule/TransformToStrict.php b/library/HTMLPurifier/HTMLModule/TransformToStrict.php
index 0660d68e..08a64fa1 100644
--- a/library/HTMLPurifier/HTMLModule/TransformToStrict.php
+++ b/library/HTMLPurifier/HTMLModule/TransformToStrict.php
@@ -10,6 +10,7 @@ require_once 'HTMLPurifier/AttrTransform/Lang.php';
require_once 'HTMLPurifier/AttrTransform/TextAlign.php';
require_once 'HTMLPurifier/AttrTransform/BgColor.php';
require_once 'HTMLPurifier/AttrTransform/Border.php';
+require_once 'HTMLPurifier/AttrTransform/Name.php';
/**
* Proprietary module that transforms deprecated elements into Strict
@@ -23,7 +24,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');
+ 'blockquote', 'table', 'td', 'th', 'tr', 'img', 'a');
var $info_tag_transform = array(
// placeholders, see constructor for definitions
@@ -83,6 +84,9 @@ class HTMLPurifier_HTMLModule_TransformToStrict extends HTMLPurifier_HTMLModule
$this->info['img']->attr_transform_pre['border'] = new HTMLPurifier_AttrTransform_Border();
+ $this->info['img']->attr_transform_pre['name'] =
+ $this->info['a']->attr_transform_pre['name'] = new HTMLPurifier_AttrTransform_Name();
+
}
var $defines_child_def = true;
diff --git a/tests/HTMLPurifier/AttrTransform/NameTest.php b/tests/HTMLPurifier/AttrTransform/NameTest.php
new file mode 100644
index 00000000..da4498fb
--- /dev/null
+++ b/tests/HTMLPurifier/AttrTransform/NameTest.php
@@ -0,0 +1,28 @@
+obj = new HTMLPurifier_AttrTransform_Name();
+ }
+
+ function test() {
+ $this->assertResult( array() );
+ $this->assertResult(
+ array('name' => 'free'),
+ array('id' => 'free')
+ );
+ $this->assertResult(
+ array('name' => 'tryit', 'id' => 'tobad'),
+ array('id' => 'tobad')
+ );
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php b/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php
index 048369dd..2ece54d4 100644
--- a/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php
+++ b/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php
@@ -172,6 +172,13 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
''
);
+ // name rewritten as id
+ $this->assertResult(
+ '',
+ '',
+ array('HTML.EnableAttrID' => true)
+ );
+
}
}
diff --git a/tests/test_files.php b/tests/test_files.php
index 9806d011..9f357bbb 100644
--- a/tests/test_files.php
+++ b/tests/test_files.php
@@ -38,6 +38,7 @@ $test_files[] = 'AttrTransform/BgColorTest.php';
$test_files[] = 'AttrTransform/BorderTest.php';
$test_files[] = 'AttrTransform/ImgRequiredTest.php';
$test_files[] = 'AttrTransform/LangTest.php';
+$test_files[] = 'AttrTransform/NameTest.php';
$test_files[] = 'AttrTransform/TextAlignTest.php';
$test_files[] = 'ChildDef/ChameleonTest.php';
$test_files[] = 'ChildDef/CustomTest.php';