Files
sean 343b4a3f3f
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-19 18:32:17 -05:00

1 line
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
tinymce.PluginManager.add("visualchars",function(c){function b(m){var g,j,f,i,p,e,h=c.getBody(),k=c.selection;if(a=!a,c.fire("VisualChars",{state:a}),m&&(e=k.getBookmark()),a){for(j=[],tinymce.walk(h,function(l){3==l.nodeType&&l.nodeValue&&-1!=l.nodeValue.indexOf(" ")&&j.push(l)},"childNodes"),f=0;f<j.length;f++){for(i=j[f].nodeValue,i=i.replace(/(\u00a0)/g,'<span data-mce-bogus="1" class="mce-nbsp">$1</span>'),p=c.dom.create("div",null,i);g=p.lastChild;){c.dom.insertAfter(g,j[f])}c.dom.remove(j[f])}}else{for(j=c.dom.select("span.mce-nbsp",h),f=j.length-1;f>=0;f--){c.dom.remove(j[f],1)}}k.moveToBookmark(e)}function d(){var e=this;c.on("VisualChars",function(f){e.active(f.state)})}var a;c.addCommand("mceVisualChars",b),c.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:d}),c.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:d,selectable:!0,context:"view",prependToContext:!0}),c.on("beforegetcontent",function(f){a&&"raw"!=f.format&&!f.draft&&(a=!0,b(!1))})});