感谢您的关注。这里的情况是:ckeditor从代码中删除<br />,无法删除第二个空间
我从包含<br />
(两个空格)在具有将被传递给ckreditor,当显示ckreditor改变从代码提供给所述 
元件<br />
的内容的客户端接收的代码。由于代码由第三方提供,不能更改(不会创建其他开发人员不会期待的其他步骤,所以我宁愿避免使用基于str_replace
的解决方案),因此我们无法删除空间到<br />
将其转化为<br />
,详见this answer。
这里是什么,我收到一个简短的例子:
<h2 dlpe-id="74">El plan perfecto0000 para una promoción única</h2>
<br />
<br />
<br />
<div class="swiper-container" dlpe-id="78">...
什么是CKEditor的输出:
<h2 dlpe-id="74">El plan perfecto0000 para una promoción única</h2>
<br />
<br />
<div class="swiper-container" dlpe-id="78">...
注意 
。我也在this post中看到配置设置可能是解决此问题的关键。问题结束后会发布我的配置。
任何帮助,以确保<br/>
不会变成 
通过调整配置文件或其他方式将不胜感激。
/**
* @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function(config) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;pre';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
config.autoParagraph = false;
config.basicEntities = false;
config.AllowedContent = "br[clear]";
};
你是否正在寻找应保持两个空间的'br'元素中的解决方案吗? '
'或者它可以是一个空间吗? – Dekel
嗨德克尔,我不介意只要最后的'
'不是用'&nbsp'替换,谢谢! –