1 | <html> |
---|
2 | <script |
---|
3 | src="ckeditor/ckeditor.js" |
---|
4 | ></script> |
---|
5 | <body> |
---|
6 | <div id="main"> |
---|
7 | <div> |
---|
8 | Some text goes here. |
---|
9 | <p> |
---|
10 | A paragraph. |
---|
11 | </p> |
---|
12 | </div> |
---|
13 | </div> |
---|
14 | </body> |
---|
15 | <script> |
---|
16 | |
---|
17 | CKEDITOR.replace('main', { |
---|
18 | allowedContent: true, |
---|
19 | |
---|
20 | on : { |
---|
21 | instanceReady : function( evt ) { |
---|
22 | this.dataProcessor.writer.setRules( 'p', { |
---|
23 | indent: true, |
---|
24 | breakBeforeOpen: true, |
---|
25 | breakAfterOpen: true, |
---|
26 | breakBeforeClose: true, |
---|
27 | breakAfterClose: true |
---|
28 | }); |
---|
29 | |
---|
30 | this.dataProcessor.writer.setRules( 'div', { |
---|
31 | indent: true, |
---|
32 | breakBeforeOpen: false, |
---|
33 | breakAfterOpen: true, |
---|
34 | breakBeforeClose: false, |
---|
35 | breakAfterClose: true |
---|
36 | }); |
---|
37 | } |
---|
38 | } |
---|
39 | }); |
---|
40 | </script> |
---|
41 | </html> |
---|