1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Add NumberSpan definition (non-DTD, but applies to enough to be useful). All widely used non-deprecated attributes have been implemented (except for rel/rev, but that's tricky). Add note about quirky COL handling and possible implementation of a workaround.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@174 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-06 03:58:48 +00:00
parent d429989f86
commit d5e75f2616
6 changed files with 75 additions and 7 deletions

View File

@@ -0,0 +1,28 @@
<?php
require_once 'HTMLPurifier/AttrDefHarness.php';
require_once 'HTMLPurifier/AttrDef/NumberSpan.php';
class HTMLPurifier_AttrDef_NumberSpanTest extends HTMLPurifier_AttrDefHarness
{
function test() {
$this->def = new HTMLPurifier_AttrDef_NumberSpan();
// this one requires a little explanation. A colspan="1" shouldn't
// exist at all: it's just a dud, since the default value is already
// supplied
$this->assertDef('1', false);
$this->assertDef('4');
$this->assertDef('4.5', '4'); // round down (truncate)
$this->assertDef('0', false);
$this->assertDef('-4', false);
$this->assertDef('asdf', false);
}
}
?>

View File

@@ -80,6 +80,9 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
<td abbr="carrot">Carrot Humungous</td>
<td>$500.23</td>
</tr>
<tr>
<td colspan="2">Taken off the market</td>
</tr>
</table>
HTML;
$expect[13] = $inputs[13];

View File

@@ -45,6 +45,7 @@ $test_files[] = 'AttrDef/TextTest.php';
$test_files[] = 'AttrDef/LangTest.php';
$test_files[] = 'AttrDef/PixelsTest.php';
$test_files[] = 'AttrDef/LengthTest.php';
$test_files[] = 'AttrDef/NumberSpanTest.php';
$test_files[] = 'IDAccumulatorTest.php';
$test_files[] = 'TagTransformTest.php';
$test_files[] = 'AttrTransform/LangTest.php';