2007-06-24 21:35:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_Injector_AutoParagraphTest extends HTMLPurifier_InjectorHarness
|
|
|
|
{
|
|
|
|
|
|
|
|
function setup() {
|
|
|
|
parent::setup();
|
2007-08-08 05:38:52 +00:00
|
|
|
$this->config->set('AutoFormat', 'AutoParagraph', true);
|
2007-06-24 21:35:34 +00:00
|
|
|
}
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
function testSingleParagraph() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Foobar',
|
|
|
|
'<p>Foobar</p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testSingleMultiLineParagraph() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par 1
|
|
|
|
Par 1 still',
|
|
|
|
'<p>Par 1
|
|
|
|
Par 1 still</p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTwoParagraphs() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
Par2',
|
2008-08-10 04:32:29 +00:00
|
|
|
"<p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p>"
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTwoParagraphsWithLotsOfSpace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Par2',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTwoParagraphsWithInlineElements() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>Par1</b>
|
|
|
|
|
|
|
|
<i>Par2</i>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p><b>Par1</b></p>
|
|
|
|
|
|
|
|
<p><i>Par2</i></p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testSingleParagraphThatLooksLikeTwo() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>Par1
|
|
|
|
|
|
|
|
Par2</b>',
|
|
|
|
'<p><b>Par1
|
|
|
|
|
|
|
|
Par2</b></p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testAddParagraphAdjacentToParagraph() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1<p>Par2</p>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphUnclosedInlineElement() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>Par1',
|
|
|
|
'<p><b>Par1</b></p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testPreservePreTags() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<pre>Par1
|
|
|
|
|
|
|
|
Par1</pre>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testIgnoreTrailingWhitespace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testDoNotParagraphBlockElements() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
<div>Par2</div>
|
|
|
|
|
|
|
|
Par3',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<div>Par2</div>
|
|
|
|
|
|
|
|
<p>Par3</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphTextAndInlineNodes() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par<b>1</b>',
|
|
|
|
'<p>Par<b>1</b></p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
2008-08-10 04:32:29 +00:00
|
|
|
function testPreserveLeadingWhitespace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'
|
|
|
|
|
|
|
|
Par',
|
2008-08-10 04:32:29 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
<p>Par</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
2008-08-10 04:32:29 +00:00
|
|
|
function testPreserveSurroundingWhitespace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'
|
|
|
|
|
|
|
|
Par
|
|
|
|
|
|
|
|
',
|
2008-08-10 04:32:29 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
<p>Par</p>
|
|
|
|
|
|
|
|
'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphInsideBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div>Par1
|
|
|
|
|
|
|
|
Par2</div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphInlineNodeInsideBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><b>Par1</b>
|
|
|
|
|
|
|
|
Par2</div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p><b>Par1</b></p>
|
|
|
|
|
|
|
|
<p>Par2</p></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNoParagraphWhenOnlyOneInsideBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult('<div>Par1</div>');
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphTwoInlineNodesInsideBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><b>Par1</b>
|
|
|
|
|
|
|
|
<i>Par2</i></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p><b>Par1</b></p>
|
|
|
|
|
|
|
|
<p><i>Par2</i></p></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testPreserveInlineNodesInPreTag() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<pre><b>Par1</b>
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
<i>Par2</i></pre>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testSplitUpInternalsOfPTagInBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><p>Foo
|
|
|
|
|
|
|
|
Bar</p></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p>Foo</p>
|
|
|
|
|
|
|
|
<p>Bar</p></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testSplitUpInlineNodesInPTagInBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><p><b>Foo</b>
|
|
|
|
|
|
|
|
<i>Bar</i></p></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p><b>Foo</b></p>
|
|
|
|
|
|
|
|
<p><i>Bar</i></p></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNoParagraphSingleInlineNodeInBlockNode() {
|
2007-09-27 00:39:05 +00:00
|
|
|
$this->assertResult( '<div><b>Foo</b></div>' );
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphInBlockquote() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<blockquote>Par1
|
|
|
|
|
|
|
|
Par2</blockquote>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<blockquote><p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p></blockquote>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNoParagraphBetweenListItem() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<ul><li>Foo</li>
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
<li>Bar</li></ul>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphSingleElementWithSurroundingSpace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div>
|
|
|
|
|
|
|
|
Bar
|
|
|
|
|
|
|
|
</div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div>
|
|
|
|
|
|
|
|
<p>Bar</p>
|
|
|
|
|
|
|
|
</div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testIgnoreExtraSpaceWithLeadingInlineNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>Par1</b>a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Par2',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p><b>Par1</b>a</p>
|
|
|
|
|
|
|
|
<p>Par2</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testAbsorbExtraEndingPTag() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
Par2</p>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testAbsorbExtraEndingDivTag() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
Par2</div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<p>Par2</p>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testDoNotParagraphSingleSurroundingSpaceInBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div>
|
|
|
|
Par1
|
2007-08-08 05:38:52 +00:00
|
|
|
</div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testBlockNodeTextDelimeterInBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div>Par1
|
|
|
|
|
|
|
|
<div>Par2</div></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p>Par1</p>
|
|
|
|
|
|
|
|
<div>Par2</div></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testBlockNodeTextDelimeterWithoutDoublespaceInBlockNode() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div>Par1
|
2007-09-27 00:39:05 +00:00
|
|
|
<div>Par2</div></div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testBlockNodeTextDelimeterWithoutDoublespace() {
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
<div>Par2</div>',
|
|
|
|
'<p>Par1
|
2008-08-10 04:32:29 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<div>Par2</div>'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTwoParagraphsOfTextAndInlineNode() {
|
2007-06-26 15:07:07 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par1
|
|
|
|
|
|
|
|
<b>Par2</b>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<p>Par1</p>
|
|
|
|
|
|
|
|
<p><b>Par2</b></p>'
|
2007-06-26 15:07:07 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testLeadingInlineNodeParagraph() {
|
2007-06-29 00:24:59 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<img /> Foo',
|
|
|
|
'<p><img /> Foo</p>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTrailingInlineNodeParagraph() {
|
2007-06-29 03:57:14 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<li>Foo <a>bar</a></li>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTwoInlineNodeParagraph() {
|
2007-06-29 03:57:14 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<li><b>baz</b><a>bar</a></li>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNoParagraphTrailingBlockNodeInBlockNode() {
|
2007-06-29 03:57:14 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><div>asdf</div><b>asdf</b></div>'
|
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphTrailingBlockNodeWithDoublespaceInBlockNode() {
|
2007-06-29 03:57:14 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<div><div>asdf</div>
|
|
|
|
|
|
|
|
<b>asdf</b></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><div>asdf</div>
|
|
|
|
|
|
|
|
<p><b>asdf</b></p></div>'
|
2007-06-29 03:57:14 +00:00
|
|
|
);
|
2007-08-08 05:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testParagraphTwoInlineNodesAndWhitespaceNode() {
|
2007-06-29 17:48:56 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>One</b> <i>Two</i>',
|
|
|
|
'<p><b>One</b> <i>Two</i></p>'
|
|
|
|
);
|
2007-06-24 21:35:34 +00:00
|
|
|
}
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
function testNoParagraphWithInlineRootNode() {
|
|
|
|
$this->config->set('HTML', 'Parent', 'span');
|
2007-06-24 21:35:34 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'Par
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
Par2'
|
2007-06-24 21:35:34 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2007-09-27 00:39:05 +00:00
|
|
|
function testInlineAndBlockTagInDivNoParagraph() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div><code>bar</code> mmm <pre>asdf</pre></div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testInlineAndBlockTagInDivNeedingParagraph() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div><code>bar</code> mmm
|
|
|
|
|
|
|
|
<pre>asdf</pre></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p><code>bar</code> mmm</p>
|
|
|
|
|
|
|
|
<pre>asdf</pre></div>'
|
2007-09-27 00:39:05 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTextInlineNodeTextThenDoubleNewlineNeedsParagraph() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div>asdf <code>bar</code> mmm
|
|
|
|
|
|
|
|
<pre>asdf</pre></div>',
|
2008-08-10 04:32:29 +00:00
|
|
|
'<div><p>asdf <code>bar</code> mmm</p>
|
|
|
|
|
|
|
|
<pre>asdf</pre></div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testUpcomingTokenHasNewline() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div>Test<b>foo</b>bar<b>bing</b>bang
|
|
|
|
|
|
|
|
boo</div>',
|
|
|
|
'<div><p>Test<b>foo</b>bar<b>bing</b>bang</p>
|
|
|
|
|
|
|
|
<p>boo</p></div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testEmptyTokenAtEndOfDiv() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div><p>foo</p>
|
|
|
|
</div>',
|
|
|
|
'<div><p>foo</p>
|
|
|
|
</div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testEmptyDoubleLineTokenAtEndOfDiv() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<div><p>foo</p>
|
|
|
|
|
|
|
|
</div>',
|
|
|
|
'<div><p>foo</p>
|
|
|
|
|
|
|
|
</div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTextState11Root() {
|
|
|
|
$this->assertResult('<div></div> ');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTextState11Element() {
|
|
|
|
$this->assertResult(
|
|
|
|
"<div><div></div>
|
|
|
|
|
|
|
|
</div>");
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTextStateLikeElementState111NoWhitespace() {
|
|
|
|
$this->assertResult('<div><p>P</p>Boo</div>', '<div><p>P</p>Boo</div>');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testElementState111NoWhitespace() {
|
|
|
|
$this->assertResult('<div><p>P</p><b>Boo</b></div>', '<div><p>P</p><b>Boo</b></div>');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testElementState133() {
|
|
|
|
$this->assertResult(
|
|
|
|
"<div><b>B</b><pre>Ba</pre>
|
|
|
|
|
|
|
|
Bar</div>",
|
|
|
|
"<div><b>B</b><pre>Ba</pre>
|
|
|
|
|
|
|
|
<p>Bar</p></div>"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testElementState22() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<ul><li>foo</li></ul>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testElementState311() {
|
|
|
|
$this->assertResult(
|
|
|
|
'<p>Foo</p><b>Bar</b>',
|
|
|
|
'<p>Foo</p>
|
|
|
|
|
|
|
|
<p><b>Bar</b></p>'
|
2007-09-27 00:39:05 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2007-08-08 05:38:52 +00:00
|
|
|
function testErrorNeeded() {
|
|
|
|
$this->config->set('HTML', 'Allowed', 'b');
|
2007-06-28 13:06:15 +00:00
|
|
|
$this->expectError('Cannot enable AutoParagraph injector because p is not allowed');
|
2007-08-08 05:38:52 +00:00
|
|
|
$this->assertResult('<b>foobar</b>');
|
2007-06-28 13:06:15 +00:00
|
|
|
}
|
|
|
|
|
2007-06-24 21:35:34 +00:00
|
|
|
}
|
|
|
|
|