mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
Implement "carryover" functionality, requested by Kinderlehrer <bitweaver@7doves.com>
This commit is a limited implementation of the "active formatting elements" algorithm implemented in HTML5, which preserves certain formatting elements such as <a> and <b> when exiting or entering nodes. Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -20,8 +20,15 @@ class HTMLPurifier_Strategy_MakeWellFormed_ErrorsTest extends HTMLPurifier_Strat
|
||||
$this->invoke('</b>');
|
||||
}
|
||||
|
||||
function testTagAutoClosed() {
|
||||
$this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', new HTMLPurifier_Token_Start('b', array(), 1, 0));
|
||||
function testTagAutoclose() {
|
||||
$this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', new HTMLPurifier_Token_Start('p', array(), 1, 0));
|
||||
$this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6));
|
||||
$this->invoke('<p>Foo<div>Bar</div>');
|
||||
}
|
||||
|
||||
function testTagCarryOver() {
|
||||
$b = new HTMLPurifier_Token_Start('b', array(), 1, 0);
|
||||
$this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $b);
|
||||
$this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6));
|
||||
$this->invoke('<b>Foo<div>Bar</div>');
|
||||
}
|
||||
|
Reference in New Issue
Block a user