我在我的项目中使用 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 获取内容时,是否有停止修剪内容的正确修剪?
我尝试了不同的选项:TinyMCE 编辑器中的换行符在预览时显示额外的行,而不是在代码中,tinymce 删除文本空格和换行符链接,但选项对我不起作用。
有谁知道我需要做出哪些改变来克服这个问题?