<\/p>)*\[caption/g,"caption] [caption"),a.content=a.content.replace(/<(object|audio|video)[\s\S]+?<\/\1>/g,function(a){return a.replace(/[\r\n\t ]+/g," ")}),a.content=a.content.replace(/
]*)?>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/
(\r\n|\n)?/g,"\n"),a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"\n")}),a.content=c(a.content)});try{b.plugins.searchreplace&&!b.controlManager.buttons.searchreplace&&b.shortcuts.remove("meta+f")}catch(a){}b.formatter.register({mark:{inline:"mark"}})}),b.on("ObjectResizeStart",function(a){var c,d,e,f=a.target,g=b.$(f);if(g.is("table")){if(f.style.width&&f.style.width.indexOf("%")!==-1)return;c=parseInt(g.parent().css("width"),10),d=parseInt(a.width,10),c&&d&&(Math.abs(c-d)<3?g.css({width:"100%"}):(e=Math.round(d/c*100),e>10&&e<200&&g.css({width:e+"%"})))}},!0),b.addMenuItem("tmaresettablesize",{text:"Reset table size",cmd:"tmaResetTableSize",icon:"dashicon dashicons-image-flip-horizontal",context:"format"}),b.addMenuItem("tmaremovetablestyles",{text:"Remove table styling",cmd:"tmaRemoveTableStyles",icon:"dashicon dashicons-editor-table",context:"format"}),b.addButton("tmaresettablesize",{title:"Reset table size",cmd:"tmaResetTableSize",icon:"dashicon dashicons-image-flip-horizontal"}),b.addButton("tmaremovetablestyles",{title:"Remove table styling",cmd:"tmaRemoveTableStyles",icon:"dashicon dashicons-editor-table"}),b.addCommand("tmaRemoveTableStyles",function(){var a=b.selection.getStart(),c=b.dom.getParents(a,"table");c&&b.$(c).attr({style:null,width:null,height:null,border:null,cellspacing:null,cellpadding:null}).find("tr, td").each(function(a,c){b.$(c).attr({style:null,width:null,height:null})})}),b.addCommand("tmaResetTableSize",function(){var a=b.selection.getStart(),c=b.dom.getParents(a,"table");c&&(d(c),b.$(c).find("tr, td").each(function(a,b){d(b)}))}),e&&(b.on("beforeSetContent",function(a){var b,c=window.wp;c&&(b=c.editor&&c.editor.autop,b||(b=c.oldEditor&&c.oldEditor.autop),a.load&&b&&a.content&&a.content.indexOf("\n")>-1&&!//i.test(a.content)&&(a.content=b(a.content)))},!0),b.settings.classic_block_editor&&b.on("beforeGetContent",function(c){if("raw"!==c.format){var d=a.$(".block-editor-block-list__block");1===d.length&&"core/freeform"===d.attr("data-type")?b.$("p").each(function(a,c){c.hasAttributes()||b.$(c).attr("data-tadv-p","keep")}):b.$("p[data-tadv-p]").removeAttr("data-tadv-p")}},!0)),{addLineBreaks:c}})}(window.tinymce);