CoreFiles by mySites.guru
class-wp-text-diff-renderer-inline.php33 lines, 979 bytes, from wordpress-6.7.9.zip
Raw History Compare with 6.7.8
md5
8797d723b1b6a9f9c68f59205e221b7d
sha1
f7da8c917339476be87217a21e8446f7b3143cb3
sha256
eb7be4557c6f9cd77c430c3212a09325c97a9ba0addf4747a48a26739d3bd439
<?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
 */
#[AllowDynamicProperties]
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" ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.stringFound,WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
		$string = str_replace( "\0", '', $string );
		$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
		$words  = str_replace( "\n", $newlineEscape, $words ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
		return $words;
	}
}

The same content is in 151 releases, WordPress 6.5-beta2 to 7.2-beta5. See them all, or every version of this file.