3 * Diff API: WP_Text_Diff_Renderer_inline class
11 * Better word splitting than the PEAR package provides.
14 * @uses Text_Diff_Renderer_inline Extends
16 class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline {
22 * @param string $string
23 * @param string $newlineEscape
26 public function _splitOnWords($string, $newlineEscape = "\n") {
27 $string = str_replace("\0", '', $string);
28 $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
29 $words = str_replace( "\n", $newlineEscape, $words );