1 | CKEDITOR.plugins.add('mycoreprocessor', { |
---|
2 | requires : [ 'htmlwriter' ], |
---|
3 | init : function(editor) { |
---|
4 | editor.dataProcessor = new CKEDITOR.mycoreprocessor(editor); |
---|
5 | } |
---|
6 | }); |
---|
7 | |
---|
8 | CKEDITOR.mycoreprocessor = function(editor) { |
---|
9 | this.editor = editor; |
---|
10 | this.writer = new CKEDITOR.htmlWriter(); |
---|
11 | this.dataFilter = new CKEDITOR.htmlParser.filter(); |
---|
12 | this.htmlFilter = new CKEDITOR.htmlParser.filter(); |
---|
13 | }; |
---|
14 | |
---|
15 | CKEDITOR.mycoreprocessor.prototype = { |
---|
16 | toHtml : function(data, fixForBody) { |
---|
17 | // all converting to html (like: data = data.replace( /</g, '<' );) |
---|
18 | return data; |
---|
19 | }, |
---|
20 | |
---|
21 | toDataFormat : function(html, fixForBody) { |
---|
22 | // all converting from html (like: html = html.replace( /<br><\/p>/gi, '\r\n');) |
---|
23 | html.replace('<' , '<'); |
---|
24 | html.replace('>' , '>'); |
---|
25 | return html; |
---|
26 | } |
---|
27 | }; |
---|