Changeset 36036
- Timestamp:
- 12/21/2015 02:42:30 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r35904 r36036 234 234 } else { 235 235 // This is an HTML element delimiter. 236 237 // Replace each & with & unless it already looks like an entity. 238 $curl = preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&', $curl ); 239 236 240 _wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags ); 237 241 } -
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r35709 r36036 11 11 12 12 function test_disable() { 13 $this->assertEquals('<pre>--- </pre>', wptexturize('<pre>---</pre>'));14 $this->assertEquals('<pre><code></code>-- </pre>', wptexturize('<pre><code></code>--</pre>'));15 16 $this->assertEquals( '<code>--- </code>', wptexturize( '<code>---</code>' ) );17 $this->assertEquals( '<kbd>--- </kbd>', wptexturize( '<kbd>---</kbd>' ) );18 $this->assertEquals( '<style>--- </style>', wptexturize( '<style>---</style>' ) );19 $this->assertEquals( '<script>--- </script>', wptexturize( '<script>---</script>' ) );20 $this->assertEquals( '<tt>--- </tt>', wptexturize( '<tt>---</tt>' ) );13 $this->assertEquals('<pre>---&</pre>', wptexturize('<pre>---&</pre>')); 14 $this->assertEquals('<pre><code></code>--&</pre>', wptexturize('<pre><code></code>--&</pre>')); 15 16 $this->assertEquals( '<code>---&</code>', wptexturize( '<code>---&</code>' ) ); 17 $this->assertEquals( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) ); 18 $this->assertEquals( '<style>---&</style>', wptexturize( '<style>---&</style>' ) ); 19 $this->assertEquals( '<script>---&</script>', wptexturize( '<script>---&</script>' ) ); 20 $this->assertEquals( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) ); 21 21 22 22 $this->assertEquals('<code>href="baba"</code> “baba”', wptexturize('<code>href="baba"</code> "baba"')); … … 1269 1269 array( 1270 1270 '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a> ]', 1271 '[ photos by <a href="http://example.com/?a[]=1& a[]=2"> this guy & that guy </a> ]',1271 '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a> ]', 1272 1272 ), 1273 1273 array( 1274 1274 '[photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a>]', 1275 '[photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a>]', 1275 '[photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a>]', 1276 ), 1277 array( 1278 '& <script>&&</script>', 1279 '& <script>&&</script>' 1276 1280 ), 1277 1281 array(
Note: See TracChangeset
for help on using the changeset viewer.