mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 07:12:15 +09:00
issue 1292 fixed close tag error.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10383 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d9f04b3c1b
commit
14c2459992
1 changed files with 14 additions and 7 deletions
|
|
@ -5143,7 +5143,6 @@ xe.XE_XHTMLFormatter = $.Class({
|
|||
|
||||
TO_IR : function(sContent) {
|
||||
var stack = [];
|
||||
|
||||
// remove xeHandled attrs
|
||||
/*
|
||||
sContent = sContent.replace(/xeHandled="YES"/ig,'');
|
||||
|
|
@ -5210,19 +5209,26 @@ xe.XE_XHTMLFormatter = $.Class({
|
|||
|
||||
return '<'+tag+' '+$.trim(attrs)+'>';
|
||||
} else {
|
||||
stack[stack.length] = {tag:tag, state:state};
|
||||
stack.push({tag:tag, state:state});
|
||||
}
|
||||
} else {
|
||||
var tags = [], t = '';
|
||||
|
||||
// remove unnecessary closing tag
|
||||
if (!stack.length) return '';
|
||||
if (!stack.length){
|
||||
return '';
|
||||
}
|
||||
|
||||
do {
|
||||
t = stack.pop();
|
||||
if (t.tag != tag) continue;
|
||||
if (t.state != 'deleted') tags.push('</'+t.tag+'>');
|
||||
} while(stack.length && t.tag != tag);
|
||||
t = stack[stack.length-1];
|
||||
if (t.tag != tag){
|
||||
continue;
|
||||
}
|
||||
if (t.state != 'deleted'){
|
||||
tags.push('</'+t.tag+'>');
|
||||
}
|
||||
stack.pop();
|
||||
} while(stack.length && t.tag == tag);
|
||||
|
||||
return tags.join('');
|
||||
}
|
||||
|
|
@ -5237,6 +5243,7 @@ xe.XE_XHTMLFormatter = $.Class({
|
|||
t = stack.pop();
|
||||
if (t.state != 'deleted') sContent += '</'+t.tag+'>';
|
||||
} while(stack.length);
|
||||
|
||||
}
|
||||
|
||||
return sContent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue