/** * USOF Field: Editor */ ! function( $, _undefined ) { const _window = window; if ( $ush.isUndefined( _window.$usof ) ) { return; } /** * Adds
and
tags where appropriate for plain text or HTML input,
* mimicking WordPress’s wpautop behavior.
*/
function us_wpautop( text ) {
var restoreLineBreak = false,
restoreTagBr = false;
const blockTags = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
text = $ush.toString( text );
text = text.replace( /\r\n|\r/g, "\n" );
// Remove line breaks inside