CoreFiles by mySites.guru
class-wp-text-diff-renderer-inline.php34 lines, 830 bytes, from wordpress-6.2.10.zip
Raw History Compare with 6.2.9
md5
9dccdcdeafbf6692833830175c481fac
sha1
608a5c989b2ea0b6e2309935afb3019ae52cf644
sha256
8d06b2e563d0ed23f337681f038b5476a7b2f520e20db96d163f087bf6032523
<?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
		$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 52 releases, WordPress 6.2-beta1 to 6.3.14. See them all, or every version of this file.