config->set('AutoFormat.AutoParagraph', true); } public function testSingleParagraph() { $this->assertResult( 'Foobar', '

Foobar

' ); } public function testSingleMultiLineParagraph() { $this->assertResult( 'Par 1 Par 1 still', '

Par 1 Par 1 still

' ); } public function testTwoParagraphs() { $this->assertResult( 'Par1 Par2', "

Par1

Par2

" ); } public function testTwoParagraphsWithLotsOfSpace() { $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); } public function testTwoParagraphsWithInlineElements() { $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); } public function testSingleParagraphThatLooksLikeTwo() { $this->assertResult( 'Par1 Par2', '

Par1 Par2

' ); } public function testAddParagraphAdjacentToParagraph() { $this->assertResult( 'Par1

Par2

', '

Par1

Par2

' ); } public function testParagraphUnclosedInlineElement() { $this->assertResult( 'Par1', '

Par1

' ); } public function testPreservePreTags() { $this->assertResult( '
Par1

Par1
' ); } public function testIgnoreTrailingWhitespace() { $this->assertResult( 'Par1 ', '

Par1

' ); } public function testDoNotParagraphBlockElements() { $this->assertResult( 'Par1
Par2
Par3', '

Par1

Par2

Par3

' ); } public function testParagraphTextAndInlineNodes() { $this->assertResult( 'Par1', '

Par1

' ); } public function testPreserveLeadingWhitespace() { $this->assertResult( ' Par', '

Par

' ); } public function testPreserveSurroundingWhitespace() { $this->assertResult( ' Par ', '

Par

' ); } public function testParagraphInsideBlockNode() { $this->assertResult( '
Par1 Par2
', '

Par1

Par2

' ); } public function testParagraphInlineNodeInsideBlockNode() { $this->assertResult( '
Par1 Par2
', '

Par1

Par2

' ); } public function testNoParagraphWhenOnlyOneInsideBlockNode() { $this->assertResult('
Par1
'); } public function testParagraphTwoInlineNodesInsideBlockNode() { $this->assertResult( '
Par1 Par2
', '

Par1

Par2

' ); } public function testPreserveInlineNodesInPreTag() { $this->assertResult( '
Par1

Par2
' ); } public function testSplitUpInternalsOfPTagInBlockNode() { $this->assertResult( '

Foo Bar

', '

Foo

Bar

' ); } public function testSplitUpInlineNodesInPTagInBlockNode() { $this->assertResult( '

Foo Bar

', '

Foo

Bar

' ); } public function testNoParagraphSingleInlineNodeInBlockNode() { $this->assertResult( '
Foo
' ); } public function testParagraphInBlockquote() { $this->assertResult( '
Par1 Par2
', '

Par1

Par2

' ); } public function testNoParagraphBetweenListItem() { $this->assertResult( '' ); } public function testParagraphSingleElementWithSurroundingSpace() { $this->assertResult( '
Bar
', '

Bar

' ); } public function testIgnoreExtraSpaceWithLeadingInlineNode() { $this->assertResult( 'Par1a Par2', '

Par1a

Par2

' ); } public function testAbsorbExtraEndingPTag() { $this->assertResult( 'Par1 Par2

', '

Par1

Par2

' ); } public function testAbsorbExtraEndingDivTag() { $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); } public function testDoNotParagraphSingleSurroundingSpaceInBlockNode() { $this->assertResult( '
Par1
' ); } public function testBlockNodeTextDelimeterInBlockNode() { $this->assertResult( '
Par1
Par2
', '

Par1

Par2
' ); } public function testBlockNodeTextDelimeterWithoutDoublespaceInBlockNode() { $this->assertResult( '
Par1
Par2
' ); } public function testBlockNodeTextDelimeterWithoutDoublespace() { $this->assertResult( 'Par1
Par2
', '

Par1

Par2
' ); } public function testTwoParagraphsOfTextAndInlineNode() { $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); } public function testLeadingInlineNodeParagraph() { $this->assertResult( ' Foo', '

Foo

' ); } public function testTrailingInlineNodeParagraph() { $this->assertResult( '
  • Foo bar
  • ' ); } public function testTwoInlineNodeParagraph() { $this->assertResult( '
  • bazbar
  • ' ); } public function testNoParagraphTrailingBlockNodeInBlockNode() { $this->assertResult( '
    asdf
    asdf
    ' ); } public function testParagraphTrailingBlockNodeWithDoublespaceInBlockNode() { $this->assertResult( '
    asdf
    asdf
    ', '
    asdf

    asdf

    ' ); } public function testParagraphTwoInlineNodesAndWhitespaceNode() { $this->assertResult( 'One Two', '

    One Two

    ' ); } public function testNoParagraphWithInlineRootNode() { $this->config->set('HTML.Parent', 'span'); $this->assertResult( 'Par Par2' ); } public function testInlineAndBlockTagInDivNoParagraph() { $this->assertResult( '
    bar mmm
    asdf
    ' ); } public function testInlineAndBlockTagInDivNeedingParagraph() { $this->assertResult( '
    bar mmm
    asdf
    ', '

    bar mmm

    asdf
    ' ); } public function testTextInlineNodeTextThenDoubleNewlineNeedsParagraph() { $this->assertResult( '
    asdf bar mmm
    asdf
    ', '

    asdf bar mmm

    asdf
    ' ); } public function testUpcomingTokenHasNewline() { $this->assertResult( '
    Testfoobarbingbang boo
    ', '

    Testfoobarbingbang

    boo

    ' ); } public function testEmptyTokenAtEndOfDiv() { $this->assertResult( '

    foo

    ', '

    foo

    ' ); } public function testEmptyDoubleLineTokenAtEndOfDiv() { $this->assertResult( '

    foo

    ', '

    foo

    ' ); } public function testTextState11Root() { $this->assertResult('
    '); } public function testTextState11Element() { $this->assertResult( "
    "); } public function testTextStateLikeElementState111NoWhitespace() { $this->assertResult('

    P

    Boo
    ', '

    P

    Boo
    '); } public function testElementState111NoWhitespace() { $this->assertResult('

    P

    Boo
    ', '

    P

    Boo
    '); } public function testElementState133() { $this->assertResult( "
    B
    Ba
    Bar
    ", "
    B
    Ba

    Bar

    " ); } public function testElementState22() { $this->assertResult( '' ); } public function testElementState311() { $this->assertResult( '

    Foo

    Bar', '

    Foo

    Bar

    ' ); } public function testAutoClose() { $this->assertResult( '


    ' ); } public function testErrorNeeded() { $this->config->set('HTML.Allowed', 'b'); $this->expectError('Cannot enable AutoParagraph injector because p is not allowed'); $this->assertResult('foobar'); } public function testParentElement() { $this->config->set('HTML.Allowed', 'p,ul,li'); $this->assertResult('Foo', "

    Foo

    \n\n"); } } // vim: et sw=4 sts=4