Ticket #9437: 9437-1.patch
| File 9437-1.patch, 1.7 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/formatting.php
441 441 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 442 442 443 443 if ( $br ) { 444 $pee = preg_replace_callback('/<(script|style ).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);444 $pee = preg_replace_callback('/<(script|style|svg).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee); 445 445 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 446 446 $pee = str_replace('<WPPreserveNewline />', "\n", $pee); 447 447 } -
tests/phpunit/tests/formatting/Autop.php
400 400 401 401 $this->assertEquals( $expected, trim( wpautop( $content ) ) ); 402 402 } 403 404 function test_that_wpautop_ignores_inline_svgs() { 405 $content= 406 '<svg xmlns="http://www.w3.org/2000/svg"> 407 <circle cx="50" cy="50" r="30" fill="blue"> 408 <animateTransform attributeName="transform" type="scale" to="1.5" dur="2s" fill="freeze"/> 409 </circle> 410 </svg>'; 411 $expected='<p>'.$content.'</p>'; 412 $this->assertEquals( $expected, trim( wpautop( $content ) ) ); 413 } 414 415 function test_that_wpautop_ignores_inline_scripts() { 416 $content= 417 '<script type="text/javascript"> 418 419 var dummy = 1; 420 </script>'; 421 $expected='<p>'.$content.'</p>'; 422 $this->assertEquals( $expected, trim( wpautop( $content ) ) ); 423 } 424 403 425 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)