jquery 在获取内容tinymce时禁用add br标记

qlfbtfca  于 4个月前  发布在  jQuery
关注(0)|答案(1)|浏览(57)

我有这样的问题:
我正在使用TinyMCE v6。每当我使用:

tinymce.get("html").getContent()

字符串
它总是在换行符之后添加<br>标记。
那么谁能帮我禁用换行符后的自动添加<br>标记?
我试过:

forced_root_block: false,
force_br_newlines: false,
force_p_newlines: false,


但它在V6中不起作用。
这是我的代码

tinymce.init({
    selector: 'textarea#html',
    plugins: 'anchor autolink charmap codesample emoticons image media code link lists searchreplace table visualblocks wordcount',
    imagetools_cors_hosts: ['picsum.photos'],
    menubar: 'file edit view insert format tools table help',
    toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough highlight custom | link image media code ruby table mergetags | align lineheight | tinycomments | numlist bullist indent outdent | emoticons charmap removeformat',
    toolbar_sticky: true,
    // toolbar_mode: 'floating',
    toolbar_mode: 'wrap',
    autosave_ask_before_unload: true,
    paste_data_images: true,
    autosave_interval: '30s',
    autosave_retention: '2m',
    height: 800,
    statusbar: false,
    forced_root_block: false,
    force_br_newlines: false,
    force_p_newlines: false,
    extended_valid_elements: 'script[language|type|src]',
    content_css: ['/dist/css/adminlte.min.css'],
    content_css_cors: true,
    importcss_append: true,
    convert_urls: false
});


真的很抱歉我的英语不好!
在TinyMCE v6中禁用自动添加<br>标记

dfuffjeb

dfuffjeb1#

将换行行为选项设置为“block”,以防止按回车键时编辑器中出现任何新的换行符:您可以使用此选项。

newline_behavior:'block',
更多帮助请查看此文档帮助页. https://www.tiny.cloud/blog/remove-line-breaks/

相关问题