Proper support for name attribute in <a> and <img>
commitfd384129bf67e4b53b41183948661913ae1655a7
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Fri, 27 Jun 2008 19:44:27 +0000 (27 15:44 -0400)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Fri, 27 Jun 2008 19:44:27 +0000 (27 15:44 -0400)
treeca7f93c9b614018b9dcf55c00804cad6c7fa67d9
parentf8b47c64ddfc8d3b88ebcffcaf25a85474dd4625
Proper support for name attribute in <a> and <img>

Prior to this commit, the name attribute was unilaterally removed, except
for Strict doctypes or a heavy TidyLevel, when it was converted to an id
attribute. As name is actually permitted in both HTML 4.01 Strict and
XHTML 1.0 Strict, although deprecated, the more sensible default behavior
is to allow it unless TidyLevel is heavy.

Our implementation is slightly stricter than the specs, as name attributes are
treated as first class IDs, disallowing <a name="foo" id="foo"> or duplicate
names. The former should be treated as a special case, but that will be
a separate commit.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
NEWS
TODO
configdoc/usage.xml
library/HTMLPurifier.includes.php
library/HTMLPurifier.safe-includes.php
library/HTMLPurifier/HTMLModule/Name.php [new file with mode: 0644]
library/HTMLPurifier/HTMLModule/Tidy/Name.php [new file with mode: 0644]
library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
library/HTMLPurifier/HTMLModuleManager.php
tests/HTMLPurifierTest.php