From: Alan Date: Fri, 7 Jan 2022 07:23:40 +0000 (+0800) Subject: Roo/htmleditor/TidyWriter.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=32f64432f12a1f4c7f9d9b95c8ac003d9b7f7303 Roo/htmleditor/TidyWriter.js --- diff --git a/Roo/htmleditor/TidyWriter.js b/Roo/htmleditor/TidyWriter.js index 93c482939f..4d23dcd90e 100644 --- a/Roo/htmleditor/TidyWriter.js +++ b/Roo/htmleditor/TidyWriter.js @@ -227,6 +227,14 @@ Roo.htmleditor.TidyWriter.prototype = { { text = this.indentstr + text.replace(/^\s+/g,''); } + // repace long lines + text = this.indentstr + text.replace( + /(?![^\n]{1,64}$)([^\n]{1,64})\s/g, '$1\n' + this.indentstr + ); + // remoeve the last whitespace / line break. + text = text.replace(/\s+$/,''); + + } this.html[this.html.length] = text;