#19474078 p 태그가 하나이면 p 태그 제거

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8031 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-01-18 09:34:26 +00:00
parent e24e6b4d85
commit 2984614918

View file

@ -31,7 +31,8 @@ function editorStart_xe(editor_seq, primary_key, content_key, editor_height, col
// filters
xeed.cast('REGISTER_FILTER', ['r2t', plz_standard]);
xeed.cast('REGISTER_FILTER', ['r2t', remove_baseurl]);
xeed.cast('REGISTER_FILTER', ['in', inline_styled['in']]);
xeed.cast('REGISTER_FILTER', ['r2t', unwrap_single_para]);
xeed.cast('REGISTER_FILTER', ['in', inline_styled['in']]);
xeed.cast('REGISTER_FILTER', ['out', inline_styled['out']]);
// Set standard API
@ -83,6 +84,17 @@ function remove_baseurl(code) {
return code.replace(reg, function(m0,m1,m2){ return ' '+m1+'='+m2; });
}
// unwrap single paragraph
function unwrap_single_para(code) {
var match = $.trim(code).match(/<p[\s>]/g);
if (match && match.length == 1) {
code = code.replace(/<\/?p(?:\s[^>]+)?>/g, '');
}
return code;
};
// inline styled box
var inline_styled = {
'in' : function(code) {