TinyMCE 不会为 \n 插入换行符

TinyMCE does not insert line break for \n

我有以下文字

“3 座令人惊叹的私人别墅。\n\n 海滩别墅,\n\n悬崖别墅,“

在TinyMCE中显示此文本,以下是TinyMCE js代码

 tinyMCE.init({
    mode: "specific_textareas",
    element: editorID,
    encoding: "xml",
    content_css: hostURL + editorcssURL,
    editor_selector: editorClass,
    height: 500,
    external_plugins: { "nanospell": "nanospell/plugin.js" },
    nanospell_autostart: true,
    plugins: ["code searchreplace link print preview charmap paste advlist image textcolor"],
    default_link_target: isgConstants.DefaultTargetTypeForTinyMCEEditorLink,
    link_class_list: [
    { title: 'Special link', value: 'simple-link' },
    { title: 'None', value: '' }
    ],
    nanospell_server: "asp.net", // choose "php" "asp" "asp.net" or "java"
    spellchecker_languages: "English=en",
    relative_urls: false,
    style_formats: styleformat || "",
    toolbar: "cut copy paste | undo redo | bold italic underline strikethrough | bullist numlist outdent indent | charmap link image subscript superscript nanospell | print preview  code | styleselect | forecolor | backcolor | " + EditorCustomButtons,
    forced_root_block: "",
    menubar: "file edit insert format",
    statusbar: false,
    toolbar_items_size: 'medium',
    valid_elements: '*[*]',
    setup: function (event) {
      event.on('keyup', function (e) {
        isgProductText.GetCharCount(event, editorID);
      });
      event.on('init', function (e) {
        var text = tinyMCE.get(editorID).getContent({ format: 'text' });
        var numOfChar = text.trim().length;
        $.trim($('#noOfURChar').text(numOfChar));
      });
      //Add special link button - mk
      event.addButton('addclasstolink', {
        text: 'Special link to all',
        title: 'Add/Remove class to all',
        onclick: function () {
          var anchor = event.dom.select('a');

          var activeState = this.active();

          if (activeState) {
            $(anchor).removeClass('simple-link');
            this.active(false);
          }
          else {
            $(anchor).addClass('simple-link');
            this.active(true);
          }
        }
      });
    },
    file_browser_callback: function (field_name, url, type, win) {
      if (type == 'image') {
        $("#" + field_name).append('<input id="editorFileInpt" type="file">');
        $('#editorFileInpt').click();
        $('#editorFileInpt').change(function () { me.UploadTinyMceImage(field_name) });
      }
    }
  }); 

tinyMCE 编辑器在一行中显示“3 座令人惊叹的私人别墅。海滩别墅、悬崖别墅”。

如何在出现 \n 的地方允许换行,

而且它不显示“.\n\n之间的space”

我试过了,还是不行

    //force_p_newlines : false,
    //force_br_newlines : true,
    //convert_newlines_to_brs : false,
    //remove_linebreaks : false,
    //forced_root_block : false,

TinyMCE 是一个 HTML 编辑器,\n 字符在 HTML 中没有意义。如果您希望它成为 TinyMCE 中的换行符,您需要在将数据加载到 HTML 之前将 \n 转换为 <br>

如果您给 TinyMCE 一个没有包装 HTML 标签的文本字符串,整个字符串将被包装在一个段落中 (<p></p>) 以确保您有有效的格式良好的 HTML.

当然,在html中,\n不显示,但在代码模式下,de \n会出现...