From: Alan Date: Fri, 7 Jan 2022 06:45:53 +0000 (+0800) Subject: Roo/htmleditor/TidyWriter.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=8ff669da11e253bb25ec37a5dd92515463b35d2c Roo/htmleditor/TidyWriter.js --- diff --git a/Roo/htmleditor/TidyWriter.js b/Roo/htmleditor/TidyWriter.js index f7c91ee647..41052673d3 100644 --- a/Roo/htmleditor/TidyWriter.js +++ b/Roo/htmleditor/TidyWriter.js @@ -169,12 +169,15 @@ Roo.htmleditor.TidyWriter.prototype = { } if (this.in_pre || this.in_inline) { this.html[this.html.length] = text; - return; - + return; } // see if last line is a line break - - this.addLine(); + var indentstr = this.indentstr; + if (node.previousSibling && node.previousSibling.nodeType == 1 && Roo.htmleditor.TidyWriter.inline_elements.indexOf(node.previousSibling.nodeName) > -1) { + indentstr = ''; + } else { + this.addLine(); + } @@ -186,7 +189,7 @@ Roo.htmleditor.TidyWriter.prototype = { return; } if (!text.match(/\n/)) { - this.html.push(this.indentstr + text); + this.html.push(indentstr + text); return; }