Roo/htmleditor/TidyWriter.js
authorAlan <alan@roojs.com>
Fri, 7 Jan 2022 07:10:58 +0000 (15:10 +0800)
committerAlan <alan@roojs.com>
Fri, 7 Jan 2022 07:10:58 +0000 (15:10 +0800)
Roo/htmleditor/TidyWriter.js

index e9f75d6..e2ccd4b 100644 (file)
@@ -78,7 +78,7 @@ Roo.htmleditor.TidyWriter.prototype = {
             i_inline = false;
         }
 
-        var indentstr = i_inline || this.in_pre ? '' : this.indentstr;
+        var indentstr =  this.indentstr;
         
         // e_inline = elements that can be inline, but still allow \n before and after?
         // only 'BR' ??? any others?
@@ -92,11 +92,17 @@ Roo.htmleditor.TidyWriter.prototype = {
                     this.addLine();
                 } else if (this.lastElementEndsWS()) {
                     this.addLine();
+                } else{
+                    // otherwise - no new line. (and dont indent.)
+                    
+                    indentstr = '';
                 }
-                // otherwise - no new line.
+                
             } else {
                 this.addLine();
             }
+        } else {
+            indentstr = '';
         }
         
         this.html.push(indentstr + '<', name.toLowerCase());