mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
태그의 클래스를 없애지 않고, 에디터에서 사용하는 일부 특수한 클래스만 제거하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6131 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2bb91018b9
commit
7686512b04
1 changed files with 8 additions and 3 deletions
|
|
@ -5420,7 +5420,8 @@ var oMessageMap = {
|
||||||
var
|
var
|
||||||
regex_meanless_css1 = /<(.*?)\s+style\s*=\s*"(.*?(?:margin|padding)\s*:\s*0(?:px)?.*?|.*?\-(?:moz|ms|webkit|opera).*?)"(.*?)>/ig,
|
regex_meanless_css1 = /<(.*?)\s+style\s*=\s*"(.*?(?:margin|padding)\s*:\s*0(?:px)?.*?|.*?\-(?:moz|ms|webkit|opera).*?)"(.*?)>/ig,
|
||||||
regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig,
|
regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig,
|
||||||
regex_class = /<(.*?)\s+class\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,
|
regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig,
|
||||||
|
regex_class2 = /xe_selected_cell/g;
|
||||||
regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,
|
regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,
|
||||||
regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig,
|
regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig,
|
||||||
regex_script = /<script[\s\S]+?<\/script>/ig,
|
regex_script = /<script[\s\S]+?<\/script>/ig,
|
||||||
|
|
@ -5466,8 +5467,12 @@ xe.XE_XHTMLFormatter = $.Class({
|
||||||
return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>';
|
return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>';
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove all classes
|
// remove all useless classes
|
||||||
sContent = sContent.replace(regex_class, '<$1$2>');
|
sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){
|
||||||
|
var cls = jQuery.trim((m2 || m3 || m4 || "").replace(regex_class2, ''));
|
||||||
|
|
||||||
|
return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>';
|
||||||
|
});
|
||||||
|
|
||||||
// remove all event handler
|
// remove all event handler
|
||||||
sContent = sContent.replace(regex_handler, '<$1$2>');
|
sContent = sContent.replace(regex_handler, '<$1$2>');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue