From 8ff669da11e253bb25ec37a5dd92515463b35d2c Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 7 Jan 2022 14:45:53 +0800 Subject: [PATCH] Roo/htmleditor/TidyWriter.js --- Roo/htmleditor/TidyWriter.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; } -- 2.39.2