Newline preservation help function for wpautop

Signature

_autop_newline_preservation_helper( $matches )
matches
 (array) preg_replace_callback matches array

Return

(string)

Source

function _autop_newline_preservation_helper( $matches ) {
	return str_replace("\n", "<WPPreserveNewline />", $matches[0]);
}
WP Trac GitHub

Link here