我是tinyMce的菜鸟。我希望实现tinymce,以便用相应的内联样式(如strong,b,i,em )替换像'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
发布于 2012-11-06 11:13:43
这应该可以做到:
formats : {
bold : {inline : 'span', styles : {fontWeight : 'bold'}},
}https://stackoverflow.com/questions/13249612
复制相似问题