203 | | }, |
204 | | |
205 | | comment : function( contents ) |
206 | | { |
207 | | // If this is a comment for protected source. |
208 | | if ( contents.substr( 0, protectedSourceMarker.length ) == protectedSourceMarker ) |
209 | | { |
210 | | // Remove the extra marker for real comments from it. |
211 | | if ( contents.substr( protectedSourceMarker.length, 3 ) == '{C}' ) |
212 | | contents = contents.substr( protectedSourceMarker.length + 3 ); |
213 | | else |
214 | | contents = contents.substr( protectedSourceMarker.length ); |
215 | | |
216 | | return new CKEDITOR.htmlParser.cdata( decodeURIComponent( contents ) ); |
217 | | } |
218 | | |
219 | | return contents; |
| 286 | function unprotectSource( html ) |
| 287 | { |
| 288 | html = html.replace( /<!--\{cke_protected\}([\s\S]+?)-->/g, function( match, data ) |
| 289 | { |
| 290 | return decodeURIComponent( data ); |
| 291 | }); |
| 292 | |
| 293 | // If the protected source was set on an attribute, the < and > will be encoded |
| 294 | return html.replace( /<!--\{cke_protected\}([\s\S]+?)-->/g, function( match, data ) |
| 295 | { |
| 296 | return decodeURIComponent( data ); |
| 297 | }); |
| 298 | } |
| 299 | |