#19479734 HTML 소스 편집시 자동 줄바꿈 기능 지원, #19311066 HTML 보기 화면에 줄바꿈 정리

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8039 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-01-21 02:27:52 +00:00
parent c5683b25ed
commit 397079f435

View file

@ -34,6 +34,9 @@ function editorStart_xe(editor_seq, primary_key, content_key, editor_height, col
xeed.cast('REGISTER_FILTER', ['r2t', unwrap_single_para]);
xeed.cast('REGISTER_FILTER', ['in', inline_styled['in']]);
xeed.cast('REGISTER_FILTER', ['out', inline_styled['out']]);
xeed.cast('REGISTER_FILTER', ['r2t', auto_br.br2ln]);
xeed.cast('REGISTER_FILTER', ['out', auto_br.br2ln]);
xeed.cast('REGISTER_FILTER', ['t2r', auto_br.ln2br]);
// Set standard API
editorRelKeys[editor_seq] = {
@ -112,6 +115,16 @@ var inline_styled = {
}
};
// auto_br
var auto_br = {
'br2ln' : function(code) {
return $.trim(code.replace(/<br ?\/?>/ig, '\n'));
},
'ln2br' : function(code) {
return code.replace(/(^|[^>])\s*\r?\n\s*([^<])/g, '$1<br />$2');
}
};
window.editorStart_xe = editorStart_xe;
})(jQuery);