2

私はtinyMceの初心者です。strong,b,i,emのような非推奨のタグがのような対応するインラインスタイルに置き換えられるように、tinymceを実装したいと思います'font-weight:bold', etc

カスタムフォーマットを使ってみました

formats : {
     bold: {inline : 'span', 'styles' : 'font-weight:bold'}
}

しかし、太字の書式を適用しようとすると、エラーが発生します。

Uncaught TypeError: Object 0 has no method 'replace' 
(anonymous function) tiny_mce.js:1
e.create.run tiny_mce.js:1
e.create.setStyle tiny_mce.js:1
(anonymous function) tiny_mce.js:1
c.each tiny_mce.js:1
ab tiny_mce.js:1
an tiny_mce.js:1
Y tiny_mce.js:1
F tiny_mce.js:1
s tiny_mce.js:1
u.Bold,Italic,Underline,Strikethrough,Superscript,Subscript tiny_mce.js:1
r tiny_mce.js:1
k.create.execCommand tiny_mce.js:1
i.onclick tiny_mce.js:1
(anonymous function) tiny_mce.js:1
j tiny_mce.js:1
y tiny_mce.js:1

これがJSFIDDLEです

4

1 に答える 1

4

これはそれを行うべきです:

    formats : {
          bold : {inline : 'span', styles : {fontWeight : 'bold'}},
    }
于 2012-11-06T11:13:43.570 に答える