我将 BBCode 插件与 TinyMCE 结合使用,发现预览和 HTML 代码之间的换行符显示不一样。
我在编辑器窗口中有以下几行:
This is line one
This is line three
第二行是空的。当我在 HTML 中查看此内容时,我得到以下内容。
This is line one
This is line three
没有多余的空行。
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "bbcode",
entity_encoding : "raw",
remove_linebreaks : false,
force_p_newlines : false,
force_br_newlines : true,
forced_root_block : ''
});
我缺少什么?
我已经测试过了我的测试页 http://www2.alpinechough.com/tinyMCE_BBCode_example/与 Firefox 3.5.7 和 Google Chrome 4.0.223.11。
html:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "bbcode",
content_css : "bbcode.css",
entity_encoding : "raw",
add_unload_trigger : false,
remove_linebreaks : false,
apply_source_formatting : false
});
可以使用简单的 CSS(“bbcode.css”)删除段落之间的空格,如下所示:
p {margin:0; padding: 0;}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)