/** * 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 tags if ( text.includes( '/g, ( match ) => { return match.replace( /\n+/g, '' ); } ); } // Normalize spacing inside all tags text = text.replace( /<[^<>]+>/g, ( tag ) => { return tag.replace( /[\n\t ]+/g, ' ' ); } ); // Preserve
 and