我有一个ASP.NET页面,我在其中集成了CKEditor以显示富文本内容。 我页面上的ckeditor没有显示数据库中的\ n新行字符。即,例如 我的数据库中包含以下内容。
....................................................
12/9/2014 12:17:36 PM U.S. AZ (UTC/GMT -7), USER,A: (New)
Description: passes checks and gas
'ABC' IS CHANGED FROM 'Issues Found' TO 'Needs Check'
'Lib Check 2' IS CHANGED FROM 'Issues Found' TO 'Passed Checks - Released To None Lib'
....................................................
12/8/2014 10:29:41 AM U.S. AZ (UTC/GMT -7), USER,B: (New)
Description:
'DEF' IS CHANGED FROM 'K' TO 'Submitted: Assigned'
'Logic Status' IS CHANGED FROM 'Submitted: Not Assigned' TO 'Submitted: Assigned'
'Platform' IS CHANGED FROM 'Purley' TO 'Purley'
....................................................
12/5/2014 2:21:48 PM U.S. AZ (UTC/GMT -7), USER ,C: (New)
Description: please recheck, I found an issue
现在我希望CKEditor显示在DB中。但它显示以上文字如下
....................................................12/9/2014 12:17:36 PM U.S. AZ (UTC/GMT -7), USER,A: (New)Description: passes checks and gas'ABC' IS CHANGED FROM 'Issues Found' TO 'Needs Check''Lib Check 2' IS CHANGED FROM 'Issues Found' TO 'Passed Checks - Released To None Lib'....................................................12/8/2014 10:29:41 AM U.S. AZ (UTC/GMT -7), USER,B: (New)Description: 'DEF' IS CHANGED FROM 'K' TO 'Submitted: Assigned''Logic Status' IS CHANGED FROM 'Submitted: Not Assigned' TO 'Submitted: Assigned''Platform' IS CHANGED FROM Purley'TOPurley'....................................................12/5/2014 2:21:48 PM U.S. AZ (UTC/GMT -7), USER ,C: (New) Description: please recheck, I found an issue
如您所见,CKEditor不遵循格式。不确定Config中的哪个设置可以解决我的问题。这是我的config.js文件。我厌倦了尝试不同的配置选项但没有工作。
CKEDITOR.editorConfig = function (config) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.removePlugins = 'toolbar,elementspath,resize';
config.allowedContent = true;
config.ignoreEmptyParagraph = true;
config.entities = false;
config.basicEntities = false;
config.enterMode = CKEDITOR.ENTER_BR;
config.extraPlugins = 'htmlwriter';
};
CKEDITOR.on('instanceReady', function (ev) {
ev.editor.dataProcessor.writer.indentationChars = '\t';
ev.editor.dataProcessor.writer.selfClosingEnd = ' />';
ev.editor.dataProcessor.writer.lineBreakChars = '\n';
});