【发布时间】:2016-07-29 08:07:15
【问题描述】:
我在我的项目中使用 TinyMCE 4.x 版本,BBCode 作为源。下面是它的 TinyMCE 初始化代码,
tinymce.init({
mode: "textareas",
editor_selector: "mceEditor",
resize: "both",
forced_root_block: false,
remove_redundant_brs : false,
verify_html : false,
force_br_newlines: true,
force_p_newlines: false,
remove_redundant_brs : false,
remove_linebreaks : false,
valid_elements: 'br',
plugins: ["autolink link image anchor bbcode code noneditable"],
toolbar: "bold italic link | code | bbcode",
});
如果我在内容末尾添加换行符或额外的行/空格并尝试从 javascript(tinyMCE.activeEditor.getElement().val()) 获取内容,则获得的内容为修剪形式。当我们从 TinyMCE 获取内容时,是否有停止修剪内容的正确修剪?
我尝试了不同的选项:Linebreaks in TinyMCE editor show extra line on preview, not in code,tinymce remove text spaces and line breaks 链接,但选项对我不起作用。
有谁知道我需要做出哪些改变来克服这个问题?
【问题讨论】:
标签: tinymce tinymce-4 bbcode tinymce-plugins