From 29846149189673d45ddeca02c51d650aa8e28169 Mon Sep 17 00:00:00 2001 From: taggon Date: Tue, 18 Jan 2011 09:34:26 +0000 Subject: [PATCH] =?UTF-8?q?#19474078=20p=20=ED=83=9C=EA=B7=B8=EA=B0=80=20?= =?UTF-8?q?=ED=95=98=EB=82=98=EC=9D=B4=EB=A9=B4=20p=20=ED=83=9C=EA=B7=B8?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8031 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/skins/xeed/js/xe_interface.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/editor/skins/xeed/js/xe_interface.js b/modules/editor/skins/xeed/js/xe_interface.js index f7034b5e5..bba29f293 100644 --- a/modules/editor/skins/xeed/js/xe_interface.js +++ b/modules/editor/skins/xeed/js/xe_interface.js @@ -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(/]/g); + + if (match && match.length == 1) { + code = code.replace(/<\/?p(?:\s[^>]+)?>/g, ''); + } + + return code; +}; + // inline styled box var inline_styled = { 'in' : function(code) {