2016-09-07 3 views
0

私はtinymce 4を使用しており、フォーマットボタンを削除しています。それはとてもうまくいく。 特定の形式(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で「フォーマット」!私のために働く。小さな4.5.1 –

関連する問題