2016-09-07 3 views
0

나는 tinymce 4 및 removeformat 버튼을 사용하고 있습니다. 그것은 아주 잘 작동합니다. 이제 특정 형식 (b, strong) 만 제거해야합니다. 찾았습니다Tinymce 및 removeformat 옵션

removeformat: [ 
       {selector: 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand: true, deep : true}, 
       {selector: 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},      
       {selector: '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} 
      ], 

설명서는 어디에 있습니까? 모든 매개 변수 (확장, 깊이 ...)를 이해해야합니다.

이미지를 선택하고 형식 제거를 클릭하면 수업을 잃게됩니다. 이 문제를 어떻게 피할 수 있습니까? 선택기 선을 제거하려고했지만 작동하지 않습니다.

원본 js도 첨부하여 디버깅했습니다. 내 removeformat 줄을 고려하지 않습니다. 기본 removeformat 만 고려합니다.

감사

답변

1

공식 문서 (https://www.tinymce.com/docs/configure/content-formatting/#removingaformat)의 예는 잘못된 것입니다. 다음과 같아야합니다.

tinymce.init({ 
    selector: 'textarea', // change this value according to your HTML 
    format: { 
     removeformat: [ 
     {selector: 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand: true, deep : true}, 
     {selector: 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, 
     {selector: '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} 
     ] 
    } 
}); 
+1

예, 이미 발견했습니다. 감사. 포 마트를 형식으로 교정 할 수 있습니까? – Emanuele

+0

thx .. s!로 "formats"! 나를 위해 일합니다. 작은 4.5.1 –