projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
651e808
)
Roo/htmleditor/TidyWriter.js
author
Alan
<alan@roojs.com>
Fri, 7 Jan 2022 07:10:08 +0000
(15:10 +0800)
committer
Alan
<alan@roojs.com>
Fri, 7 Jan 2022 07:10:08 +0000
(15:10 +0800)
Roo/htmleditor/TidyWriter.js
patch
|
blob
|
history
diff --git
a/Roo/htmleditor/TidyWriter.js
b/Roo/htmleditor/TidyWriter.js
index
f9fb4cc
..
e9f75d6
100644
(file)
--- a/
Roo/htmleditor/TidyWriter.js
+++ b/
Roo/htmleditor/TidyWriter.js
@@
-72,8
+72,9
@@
Roo.htmleditor.TidyWriter.prototype = {
var is_short = empty ? Roo.htmleditor.TidyWriter.shortend_elements.indexOf(name) > -1 : false;
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()) {
+ var add_lb = name == 'BR' ? false : in_inline;
+
+ if (!add_lb && !this.in_pre && this.lastElementEndsWS()) {
i_inline = false;
}
i_inline = false;
}
@@
-83,9
+84,19
@@
Roo.htmleditor.TidyWriter.prototype = {
// only 'BR' ??? any others?
var e_inline = name == 'BR' ? false : this.in_inline;
// only 'BR' ??? any others?
var e_inline = name == 'BR' ? false : this.in_inline;
- // if this element is inline - then don't add stuff beforehand..
- if (!e_inline && !this.in_pre) {
- this.addLine();
+ // ADD LINE BEFORE tage
+ if (!this.in_pre) {
+ if (in_inline) {
+ //code
+ if (is_br) {
+ this.addLine();
+ } else if (this.lastElementEndsWS()) {
+ this.addLine();
+ }
+ // otherwise - no new line.
+ } else {
+ this.addLine();
+ }
}
this.html.push(indentstr + '<', name.toLowerCase());
}
this.html.push(indentstr + '<', name.toLowerCase());