projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Roo/htmleditor/TidyWriter.js
[roojs1]
/
Roo
/
htmleditor
/
TidyWriter.js
diff --git
a/Roo/htmleditor/TidyWriter.js
b/Roo/htmleditor/TidyWriter.js
index
d604874
..
2654f20
100644
(file)
--- a/
Roo/htmleditor/TidyWriter.js
+++ b/
Roo/htmleditor/TidyWriter.js
@@
-67,9
+67,10
@@
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 indentstr =
this.
in_inline || this.in_pre ? '' : this.indentstr;
+ var indentstr = in_inline || this.in_pre ? '' : this.indentstr;
- if (!this.in_inline && !this.in_pre) {
+ // if this element is inline - then don't add stuff beforehand..
+ if (!in_inline && !this.in_pre) {
this.addLine();
}
this.addLine();
}
@@
-138,13
+139,15
@@
Roo.htmleditor.TidyWriter.prototype = {
end: function(name) {
var value;
this.popState();
end: function(name) {
var value;
this.popState();
- var indentstr = '';
- if (!this.in_pre && !this.in_inline) {
+ var indentstr = '';
+ var in_inline = this.in_inline || Roo.htmleditor.TidyWriter.inline_elements.indexOf(name) > -1;
+
+ if (!this.in_pre && !in_inline) {
this.addLine();
indentstr = this.indentstr;
}
this.html.push(indentstr + '</', name.toLowerCase(), '>');
this.addLine();
indentstr = this.indentstr;
}
this.html.push(indentstr + '</', name.toLowerCase(), '>');
-
+ this.last_inline = in_inline;
// pop the indent state..
},
// pop the indent state..
},
@@
-164,7
+167,7
@@
Roo.htmleditor.TidyWriter.prototype = {
if (text.length < 1) {
return;
}
if (text.length < 1) {
return;
}
- if (this.in_pre || this.i
s
_inline) {
+ if (this.in_pre || this.i
n
_inline) {
this.html[this.html.length] = text;
return;
this.html[this.html.length] = text;
return;