mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Optimize the wptexturize() loop:
* Take the ampersand pattern out of the loop for speed. * Fix old bugs in the ampersand pattern. * Refactor `_wptexturize_pushpop_element()` without PCRE for speed. * Update unit tests. Props miqrogroove. Fixes #28623. git-svn-id: https://develop.svn.wordpress.org/trunk@28831 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -829,9 +829,17 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
"word & word",
|
||||
"word & word",
|
||||
),
|
||||
array(
|
||||
"word ઼ word",
|
||||
"word ઼ word",
|
||||
),
|
||||
array(
|
||||
"word Δ word",
|
||||
"word Δ word",
|
||||
),
|
||||
array(
|
||||
"word &# word",
|
||||
"word &# word", // invalid output?
|
||||
"word &# word",
|
||||
),
|
||||
array(
|
||||
"word &44; word",
|
||||
@@ -839,11 +847,19 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
),
|
||||
array(
|
||||
"word && word",
|
||||
"word && word",
|
||||
"word && word",
|
||||
),
|
||||
array(
|
||||
"word &!amp; word",
|
||||
"word &!amp; word",
|
||||
"word &!amp; word",
|
||||
),
|
||||
array(
|
||||
"word &#",
|
||||
"word &#",
|
||||
),
|
||||
array(
|
||||
"word &",
|
||||
"word &",
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1285,6 +1301,10 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
|
||||
'<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
|
||||
'<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
|
||||
),
|
||||
array(
|
||||
'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', // Ensure we are not corrupting image URLs.
|
||||
'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user