2014-02-26 91 views
1

当我在ckeditor中创建django管理员的帖子时,它成为一个好看的帖子。但是当我需要编辑它时,我会在wysiwyg模式下看到所有html标签和样式(所有源代码)。Django ckeditor在wysiwyg中粘贴html标签

当我写:
enter image description here

'保存并继续编辑'
enter image description here

我用RichTextField在我的模型之后。
P.S. 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, 
    }, 
} 

回答

0

这可能是“forcePasteAsPlainText”:的确,

克隆我的Django的CKEditor的扩展的回购和运行演示应用程序 - https://github.com/riklaunim/django-ckeditor - 检查它是否适合你的管理员,如果所以应用您的设置和比较

+0

它与你的应用程序,但不与我的工作很好......它似乎问题在我身边 –

+0

你的浏览器的JS控制台中有任何错误?如果没有开始添加你的配置一块一块的演示,直到它将复制问题。 – Riklaunim