wp/wp-includes/class-wp-text-diff-renderer-inline.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 21 48c4eec2b7e6
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
    21 	 *
    21 	 *
    22 	 * @param string $string
    22 	 * @param string $string
    23 	 * @param string $newlineEscape
    23 	 * @param string $newlineEscape
    24 	 * @return string
    24 	 * @return string
    25 	 */
    25 	 */
    26 	public function _splitOnWords($string, $newlineEscape = "\n") {
    26 	public function _splitOnWords( $string, $newlineEscape = "\n" ) {
    27 		$string = str_replace("\0", '', $string);
    27 		$string = str_replace( "\0", '', $string );
    28 		$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
    28 		$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
    29 		$words  = str_replace( "\n", $newlineEscape, $words );
    29 		$words  = str_replace( "\n", $newlineEscape, $words );
    30 		return $words;
    30 		return $words;
    31 	}
    31 	}
    32 
    32