我已经通过以下方式将CKeditor集成到ASP.NET webforms中:
CKEditor.NET.dll.与
包含所有js、css和图片的
aspx页面I中的
<%@ Assembly="CKEditor.NET“Namespace="CKEditor.NET”TagPrefix="CKEditor“%>
然后,我尝试使用以下代码将默认值放入CKeditor:
ckEditorContent.Text = "SampleText" + "\r\n" + "SampleText";但是输出不会中断到一个新的行:

我还试过Environment.NewLine。也不起作用。
发布于 2022-04-19 05:19:57
使用<pre>标记。
ckEditorContent.Text ="<pre>"+ "SampleText" + "<br/>" + "SampleText" + "</pre>";或者您可以更改配置以添加换行符。
config.protectedSource.push(/\n/g); https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-protectedSource
https://stackoverflow.com/questions/71919060
复制相似问题