From 32f64432f12a1f4c7f9d9b95c8ac003d9b7f7303 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 7 Jan 2022 15:23:40 +0800 Subject: [PATCH] Roo/htmleditor/TidyWriter.js --- Roo/htmleditor/TidyWriter.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.2