Beispiel #1
0
/**
 * Separate HTML elements and comments from the text.
 *
 * @since 4.2.4
 *
 * @param string $input The text which has to be formatted.
 * @return array The formatted text.
 */
function wp_html_split($input)
{
    return preg_split(get_html_split_regex(), $input, -1, PREG_SPLIT_DELIM_CAPTURE);
}
 /**
  * Automated performance testing of the main regex.
  *
  * @dataProvider data_whole_posts
  */
 function test_pcre_performance($input)
 {
     $regex = get_html_split_regex();
     $result = benchmark_pcre_backtracking($regex, $input, 'split');
     return $this->assertLessThan(200, $result);
 }