obj = new HTMLPurifier_Strategy_FixNesting(); } function test() { // legal inline $this->assertResult('Bold text'); // legal inline and block // as the parent element is considered FLOW $this->assertResult('Blank
Block
'); // illegal block in inline $this->assertResult( '
Illegal div.
', 'Illegal div.' ); // same test with different configuration (fragile) $this->assertResult( '
Illegal div.
', '<div>Illegal div.</div>', array('Core.EscapeInvalidChildren' => true) ); // test of empty set that's required, resulting in removal of node $this->assertResult('', ''); // test illegal text which gets removed $this->assertResult( '', '' ); // test custom table definition $this->assertResult( '
Cell 1
', '
Cell 1
' ); $this->assertResult('
', ''); // breaks without the redundant checking code $this->assertResult('
', ''); // special case, prevents scrolling one back to find parent $this->assertResult('
', ''); // cascading rollbacks $this->assertResult( '
', '' ); // rollbacks twice $this->assertResult('
', ''); // block in inline ins not allowed $this->assertResult( '
Not allowed!
', 'Not allowed!' ); $this->assertResult( // alt config '
Not allowed!
', '<div>Not allowed!</div>', array('Core.EscapeInvalidChildren' => true) ); // test block element that has inline content $this->assertResult( '

Not allowed!

', '

Not allowed!

' ); // test exclusions $this->assertResult( 'Not allowed', '' ); // stacked ins/del $this->assertResult( '

Not allowed!

', '

Not allowed!

' ); // test inline parent $this->assertResult( 'Bold', true, array('HTML.Parent' => 'span') ); $this->assertResult( '
Reject
', 'Reject', array('HTML.Parent' => 'span') ); $this->expectError('Cannot use unrecognized element as parent.'); $this->assertResult( '
Accept
', true, array('HTML.Parent' => 'script') ); } } ?>