Changeset 468
- Timestamp:
- 03/03/06 16:04:39 (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
r448 r468 54 54 /*19*/ new RegExp().compile(/(<pre[^>]*>)(\s|[^\s])*?(<\/pre>)/g),//find content inside pre tags 55 55 /*20*/ new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g),//find content NOT inside comments 56 /*21*/ new RegExp().compile(/\S*=""/g) //find empty attributes 56 /*21*/ new RegExp().compile(/\S*=""/g), //find empty attributes 57 /*22*/ new RegExp().compile(/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<[^>]*>/g) //find all tags, including comments and php 57 58 ]; 58 59 … … 132 133 HTMLArea.getHTML = function(root, outputRoot, editor) { 133 134 var html = ""; 135 var c = HTMLArea.RegExpCache; 134 136 135 137 if(root.nodeType == 11) {//document fragment … … 141 143 temp.appendChild(j.cloneNode(true)); 142 144 } 143 html += temp.innerHTML.replace(/<[^\?!][^>]*>/gi, function(tag){return editor.cleanHTML(tag)}); 145 html += temp.innerHTML.replace(c[22], function(tag){ 146 if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags 147 else return editor.cleanHTML(tag)}); 144 148 145 149 } else { … … 167 171 //pass tags to cleanHTML() one at a time 168 172 //includes support for htmlRemoveTags config option 169 html += innerhtml.replace( /<((<[^>]*>)*|[^<>]*)*>/gi, function(tag){173 html += innerhtml.replace(c[22], function(tag){ 170 174 if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags 171 175 else if(!(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,'$1'))))
