【问题标题】:Django ckeditor pastes html tags in wysiwygDjango ckeditor 在所见即所得中粘贴 html 标签
【发布时间】:2014-03-29 10:18:33
【问题描述】:

当我使用 ckeditor 在 django admin 中创建帖子时,它会是一篇好看的帖子。但是当我需要编辑它时,我会在所见即所得模式下看到所有 html 标签和样式(所有源代码)。

当我写信时:

“保存并继续编辑”后

我在模型中使用 RichTextField。
附言django-ckeditor-从 PyPI 更新
也许我的配置有问题?

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'UltraFull',
        'height': 300,
        'toolbar_UltraFull': [
            ['Font', 'FontSize', 'Format'],
            ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'],
            [
                'NumberedList', 'BulletedList', '-',
                'Outdent', 'Indent', '-',
                'Blockquote', '-',
                'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'
            ],
            ['Link', 'Unlink', 'Anchor'],
            ['Image', 'Flash', 'Table', 'HorizontalRule', 'PageBreak', 'Smiley', 'SpecialChar'],
            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],
            ['TextColor', 'BGColor'],
            ['Maximize', 'Source'],
        ],
        'language': 'ru',
        'forcePasteAsPlainText': True,
    },
}

【问题讨论】:

    标签: django django-admin ckeditor django-ckeditor


    【解决方案1】:

    可能是“forcePasteAsPlainText”:是的,

    克隆我的 django-ckeditor-extended 存储库并运行演示应用程序 - https://github.com/riklaunim/django-ckeditor - 检查它是否适用于您在管理员中,如果适用,则应用您的设置并进行比较

    【讨论】:

    • 它适用于您的应用程序,但不适用于我的应用程序...看来问题就在我这边
    • 浏览器的 JS 控制台是否出现错误?如果不开始将您的配置逐个添加到演示中,直到它复制问题为止。
    猜你喜欢
    • 2015-02-05
    • 1970-01-01
    • 1970-01-01
    • 2011-01-01
    • 1970-01-01
    • 2020-04-23
    • 2015-07-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多