diff --git a/static/js/Editor.js b/static/js/Editor.js index 2f09a3c..cb05a1f 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -521,17 +521,17 @@ Editor.prototype.blurred = function () { this.scrape_title(); } +Editor.title_placeholder_char = "\u200b"; +Editor.title_placeholder_pattern = /\u200b/g; +Editor.title_placeholder_html = "​​"; + Editor.prototype.empty = function () { if ( !this.document || !this.document.body ) return true; // consider it empty as of now - return ( scrapeText( this.document.body ).length == 0 ); + return ( scrapeText( this.document.body ).replace( Editor.title_placeholder_pattern, "" ).length == 0 ); } -Editor.title_placeholder_char = "\u200b"; -Editor.title_placeholder_pattern = /\u200b/g; -Editor.title_placeholder_html = "​​"; - Editor.prototype.insert_link = function ( url ) { // get the current selection, which is the link title if ( this.iframe.contentWindow && this.iframe.contentWindow.getSelection ) { // browsers such as Firefox