config->set('HTML.Allowed', 'span[class],div,p,strong,em'); $this->config->set('AutoFormat.RemoveSpansWithoutAttributes', true); } function testSingleSpan() { $this->assertResult( 'foo', 'foo' ); } function testSingleSpanWithAttributes() { $this->assertResult( ' ', ' ' ); } function testSingleNestedSpan() { $this->assertResult( '
foo
', 'foo
' ); } function testSingleNestedSpanWithAttributes() { $this->assertResult( '', '
' ); } function testSpanWithChildren() { $this->assertResult( 'foo bar baz', 'foo bar baz' ); } function testSpanWithSiblings() { $this->assertResult( '
before inside after
', 'before inside after
' ); } function testNestedSpanWithSiblingsAndChildren() { $this->assertResult( 'a b c d e
', 'a b c d e
' ); } function testNestedSpansWithoutAttributes() { $this->assertResult( 'onetwothree', 'onetwothree' ); } function testDeeplyNestedSpan() { $this->assertResult( 'foo
', 'foo
' ); } function testNestedAlternateSpans() { $this->assertResult( 'a b c d e f ', 'a b c d e f ' ); } function testSpanWithSomeInvalidAttributes() { $this->assertResult( '', '
' ); } } // vim: et sw=4 sts=4