projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
739a73d
)
Roo/htmleditor/TidyWriter.js
author
Alan
<alan@roojs.com>
Fri, 7 Jan 2022 07:01:05 +0000
(15:01 +0800)
committer
Alan
<alan@roojs.com>
Fri, 7 Jan 2022 07:01:05 +0000
(15:01 +0800)
Roo/htmleditor/TidyWriter.js
patch
|
blob
|
history
diff --git
a/Roo/htmleditor/TidyWriter.js
b/Roo/htmleditor/TidyWriter.js
index
e4ca3a0
..
f9fb4cc
100644
(file)
--- a/
Roo/htmleditor/TidyWriter.js
+++ b/
Roo/htmleditor/TidyWriter.js
@@
-73,6
+73,9
@@
Roo.htmleditor.TidyWriter.prototype = {
var is_short = empty ? Roo.htmleditor.TidyWriter.shortend_elements.indexOf(name) > -1 : false;
var i_inline = name == 'BR' ? false : in_inline;
var is_short = empty ? Roo.htmleditor.TidyWriter.shortend_elements.indexOf(name) > -1 : false;
var i_inline = name == 'BR' ? false : in_inline;
+ if (i_inline && this.lastElementEndsWS()) {
+ i_inline = false;
+ }
var indentstr = i_inline || this.in_pre ? '' : this.indentstr;
var indentstr = i_inline || this.in_pre ? '' : this.indentstr;
@@
-142,6
+145,17
@@
Roo.htmleditor.TidyWriter.prototype = {
},
},
+
+ lastElementEndsWS : function()
+ {
+ var value = this.html.length > 0 ? this.html[this.html.length-1] : false;
+ if (value === false) {
+ return true;
+ }
+ return value.match(/\s+$/);
+
+ },
+
/**
* Writes the a end element such as </p>.
*
/**
* Writes the a end element such as </p>.
*