【问题标题】:Redactor wysiwyg - why does paste from word not working编辑器所见即所得 - 为什么从单词粘贴不起作用
【发布时间】:2013-04-11 21:53:15
【问题描述】:

我一直在职位发布表单上使用 Redactor Wysiwyg 编辑器。然而,尽管他们的网站提到了对 word 粘贴的超级清理,但我得到了很多额外的空白 <p><br />,即使在 word 标记中只有一个段落中断。有什么想法可能导致这种情况吗?其他人有同样的问题吗?

谢谢! 玛丽亚

【问题讨论】:

  • 他们只为最昂贵的版本提供支持,我真的负担不起。

标签: jquery redactor


【解决方案1】:

您需要像这样设置paragraphylinebreaks 设置:

$('#redactor').redactor({
    linebreaks: true,
    paragraphy: false
});

【讨论】:

  • 当粘贴在 Redactor v9.1.7 的 IE 10(以及所有 IE 版本,我相信)中不起作用时,这似乎也解决了我的问题。
【解决方案2】:

在我的情况下,当我在 Internet Explorer 中从 Word 粘贴到 Redactor 10 时,一些文本或段落消失了。那里的解决方案对我有用:

$('#redactor').redactor({
    pasteCallback: function(html) {
        html = html.replace("<font>", ""); // Fix Word to IE
        html = html.replace("</font>", ""); // Fix Word to IE
        return html;
    },
});

当我在粘贴之前删除由 Microsoft Word 生成的 &lt;font&gt; 标记时,一切正常。

【讨论】:

    【解决方案3】:
    $("#editor").redactor({
        pasteBeforeCallback: function (html) {
            return html.replace(/<p>\s*<\/p>/g, " ");
        }
    });
    

    【讨论】:

      猜你喜欢
      • 2014-10-17
      • 2012-04-15
      • 1970-01-01
      • 2015-05-22
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多