如何替换< b>与< strong>在TinyMCE for Plone中
问题描述:
我想在TinyMCE中将粗体标签替换为强标签.如何使用Products.TinyMCE在Plone中实现?
I would like to replace bold tag, , with strong tag, in TinyMCE. How to do it in Plone using Products.TinyMCE?
我阅读了TinyMCE文档, http://www.tinymce.com/wiki.php /Configuration:valid_elements .以下是在TinyMCE中的操作方法:
I read TinyMCE document, http://www.tinymce.com/wiki.php/Configuration:valid_elements. Below is how to do it in TinyMCE:
tinyMCE.init({
...
valid_elements : "strong/b"
});
谢谢.
答
您可以使用tinymce配置进行此操作:
You may do this using the tinymce configuration:
tinyMCE.init({
...
extended_valid_elements : "strong/b",
....
// Override internal formats
formats: {
bold : {inline : 'strong' }
},
...
});
如果您已使用b标签将编辑器内容保存在数据库中,则可能需要在服务器端用强标签替换这些标签.
In case you have editor content already saved in the database with b-tags it might be needed to replace those tags on serverside with strong-tags.