mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-13 16:34:52 +09:00
#18357077 : IE에서 P 노드가 정상적으로 생성되지 않는 경우 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6902 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d8c6bb565a
commit
3e767c202e
1 changed files with 17 additions and 0 deletions
|
|
@ -177,8 +177,25 @@ function editorGetContentTextarea_xe(editor_sequence) {
|
|||
if (!oEditor) return '';
|
||||
|
||||
var str = oEditor.getIR();
|
||||
|
||||
if(!jQuery.trim(str.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig, ''))) return '';
|
||||
|
||||
// 속도 문제가 있으므로 1024 문자 미만일 때만 첫 노드가 텍스트 노드인지 테스트
|
||||
// 그 이상이면 P 노드가 정상적으로 생성되었다고 가정한다.
|
||||
if (str.length < 1024) {
|
||||
var div = jQuery('<div>'+str+'</div>').eq(0);
|
||||
var nodes = div.contents();
|
||||
jQuery.each(nodes, function() {
|
||||
if (this.nodeType == 3) {
|
||||
jQuery(this).wrap('<p></p>');
|
||||
}
|
||||
});
|
||||
str = div.html();
|
||||
}
|
||||
|
||||
// 파이어폭스의 경우 의미없는 <br>이 컨텐트 마지막에 추가될 수 있다.
|
||||
str = str.replace(/<br ?\/?>$/i, '');
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue