Changeset 425
- Timestamp:
- 11/21/05 14:54:02 (7 years ago)
- Files:
-
- 1 modified
-
trunk/plugins/GetHtml/get-html.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/GetHtml/get-html.js
r422 r425 50 50 /*16*/ new RegExp().compile(/<(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|html|head|body|script)( [^>]*)?>/g),//blocklevel opening tag 51 51 /*17*/ new RegExp().compile(/<(br|hr|img|embed|param|pre|meta|link|title)[^>]*>/g),//singlet tag 52 /*18*/ new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),// exclude content betweenpre and script tags52 /*18*/ new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags 53 53 /*19*/ new RegExp().compile(/(<pre[^>]*>)(\s|[^\s])*?(<\/pre>)/g),//find content inside pre tags 54 /*20*/ new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g)// exclude comments54 /*20*/ new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g)//find content NOT inside comments 55 55 ]; 56 56 … … 94 94 s = s.replace(c[19], function(str){return str.replace(/<br \/>/g,"\n")}); 95 95 } 96 s = s.replace(c[ 20], function(st,$1,$2,$3) { //exclude comments97 strn = $3.replace(c[18], function(string) { //skip pre and script tags98 string = string.replace(/[\n\r]/gi, " ").replace(/\s+/gi," ").replace(c[14], function(str) {96 s = s.replace(c[18], function(strn) { //skip pre and script tags 97 strn = strn.replace(c[20], function(st,$1,$2,$3) { //exclude comments 98 string = $3.replace(/[\n\r]/gi, " ").replace(/\s+/gi," ").replace(c[14], function(str) { 99 99 if (str.match(c[16])) { 100 100 var s = "\n" + HTMLArea.__sindent + str; … … 117 117 return str; // this won't actually happen 118 118 }); 119 return string;120 });return $1 +strn;119 return $1 + string; 120 });return strn; 121 121 }); 122 122 if (s.charAt(0) == "\n") { … … 162 162 innerhtml = editor._doc.body.innerHTML; 163 163 } 164 //pass tags to cleanHTML() one at a time ; ignore comments and php tags164 //pass tags to cleanHTML() one at a time 165 165 //includes support for htmlRemoveTags config option 166 html += innerhtml.replace(/<[^\?!][^>]*>/gi, function(tag){ 167 if(!(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,'$1')))) 168 return editor.cleanHTML(tag); 166 html += innerhtml.replace(/<((<[^>]*>)*|[^<>]*)*>/gi, function(tag){ 167 if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags 168 else if(!(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,'$1')))) 169 return editor.cleanHTML(tag); 169 170 else return ''}); 170 171 //IE drops all </li> tags in a list except the last one
