CoreFiles by mySites.guru
class-wp-text-diff-renderer-inline.php33 lines, 716 bytes, from wordpress-5.8.4.zip
Raw History Compare with 5.8.3
md5
e8053813b36cb4b25f0deeb275ff8ca9
sha1
55a67741ea21dbc38d22380f308595ef20270314
sha256
2bd53c5c76196dc7da246443f2fee8dd7a388555b64cd97c585cd8db2f579edc
<?php
/**
 * Diff API: WP_Text_Diff_Renderer_inline class
 *
 * @package WordPress
 * @subpackage Diff
 * @since 4.7.0
 */

/**
 * Better word splitting than the PEAR package provides.
 *
 * @since 2.6.0
 * @uses Text_Diff_Renderer_inline Extends
 */
class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline {

	/**
	 * @ignore
	 * @since 2.6.0
	 *
	 * @param string $string
	 * @param string $newlineEscape
	 * @return string
	 */
	public function _splitOnWords( $string, $newlineEscape = "\n" ) {
		$string = str_replace( "\0", '', $string );
		$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
		$words  = str_replace( "\n", $newlineEscape, $words );
		return $words;
	}

}

The same content is in 340 releases, WordPress 5.1-beta1 to 6.0.18. See them all, or every version of this file.