如何禁用Redactor编辑器自动删除;?请帮帮忙。
发布于 2013-09-28 03:49:20
要修复干净的问题
打开redactor.js
syncClean: function(html)
{
if (!this.opts.fullpage) html = this.cleanStripTags(html);
html = $.trim(html);
// removeplaceholder
html = this.placeholderRemoveFromCode(html);
// remove space
html = html.replace(/​/gi, '');
html = html.replace(/​/gi, '');
// html = html.replace(/ /gi, ' '); // COMMENT THIS!
...
}利润!:)
发布于 2014-08-19 13:53:13
在新版本中,U可以将禁用 自动删除的"cleanSpaces“选项设置为"false”。
$('#redactor').redactor({ cleanSpaces: false });发布于 2013-08-14 20:25:01
您看到的文本和代码在所有浏览器中都是不同的,这就是可内容编辑字段的工作方式。例如,一些浏览器插入UTF-8字符作为某些 的空格。
RedactorJS没有提供规范化文本的方法,所以您可以手动解析文本。请检查以下内容:
var html = $('#redactor').redactor('get');
var sanitizeHtml = html.replace(/\u00a0/g, ' ').replace(/ /g, ' ');https://stackoverflow.com/questions/17516813
复制相似问题