WordPress.org

Make WordPress Core

Ticket #39307: Autop-extra-p-in-figure.php.patch

File Autop-extra-p-in-figure.php.patch, 941 bytes (added by pbearne, 3 years ago)
  • tests/phpunit/tests/formatting/Autop.php

     
    534534
    535535                $this->assertEquals( $expected, trim( wpautop( $content ) ) );
    536536        }
     537
     538        /**
     539         * wpautop() should add an extra </p>
     540         *
     541         * "<div><span></span></p>
     542         *    <div></div>
     543         *    </div>
     544         *    "
     545         * @covers ::wpautop
     546         * @uses trim
     547         *
     548         * @ticket 39377
     549         */
     550        function test_that_wpautop_doses_not_extra_closing_p_in_figure() {
     551                $content = '<figure><img src="/wp-content/uploads/example.jpg" alt="something" /><figcaption>Caption</figcaption></figure>';
     552
     553                $expected = '<figure><img src="/wp-content/uploads/example.jpg" alt="something" />
     554<figcaption>Caption</figcaption>
     555</figure>';
     556
     557                $this->assertEquals( $expected, trim( wpautop( $content ) ) );
     558        }
     559
    537560}