diff --git a/NEWS b/NEWS index 0ff188c4..8996283f 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,10 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier . Internal change ========================== +3.0.1, unknown release date +- Autoclose now operates iteratively, i.e.
now has + both span tags closed. + 3.0.0, released 2008-01-06 # HTML Purifier is PHP 5 only! The 2.1.x branch will be maintained until PHP 4 is completely deprecated, but no new features will be added diff --git a/library/HTMLPurifier/Strategy/MakeWellFormed.php b/library/HTMLPurifier/Strategy/MakeWellFormed.php index 81ad42e6..438d3f0f 100644 --- a/library/HTMLPurifier/Strategy/MakeWellFormed.php +++ b/library/HTMLPurifier/Strategy/MakeWellFormed.php @@ -156,10 +156,9 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // the parent if (!isset($parent_info->child->elements[$token->name])) { if ($e) $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', $parent); - // close the parent, then append the token + // close the parent, then re-loop to reprocess token $result[] = new HTMLPurifier_Token_End($parent->name); - $result[] = $token; - $this->currentNesting[] = $token; + $this->inputIndex--; continue; } diff --git a/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php b/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php index a227d6a7..4f5df04e 100644 --- a/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php +++ b/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php @@ -82,5 +82,12 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn ); } + function testAutoCloseMultiple() { + $this->assertResult( + '
', + '
' + ); + } + }