WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/27/2014 12:00:17 AM (7 years ago)
Author:
nacin
Message:

Remove select and input from wpautop()'s HTML blocks list.

props rachelbaker, DH-Shredder.
fixes #22230.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/Autop.php

    r27094 r27761  
    264264        $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) );
    265265    }
     266
     267    /**
     268     * wpautop() Should not add <br/> to "<select>" or "<option>" elements
     269     *
     270     * @ticket 22230
     271     */
     272    public function test_skip_select_option_elements() {
     273        $str = 'Country: <select id="state" name="state"><option value="1">Alabama</option><option value="2">Alaska</option><option value="3">Arizona</option><option value="4">Arkansas</option><option value="5">California</option></select>';
     274        $this->assertEquals( "<p>$str</p>", trim( wpautop( $str ) ) );
     275    }
    266276}
Note: See TracChangeset for help on using the changeset viewer.