gpt4 book ai didi

Django-TinyMCE : How to configure it properly?

转载 作者:行者123 更新时间:2023-12-04 23:59:32 25 4
gpt4 key购买 nike

我在摆弄 django-tinyMCE并注意到一些配置没有得到应用。这是我的 settings.py 中的代码

TINYMCE_DEFAULT_CONFIG = {
'theme' : 'advanced',
'theme_advanced_buttons1' : 'bold,italic,underline,separator,bullist,numlist,separator,link,unlink',
'theme_advanced_buttons2' : '',
'theme_advanced_buttons3' : '',
'theme_advanced_toolbar_location' : 'top',
'theme_advanced_toolbar_align': 'left',
'paste_text_sticky': 'true',
'paste_text_sticky_default' : 'true',
'valid_styles' : 'font-weight,font-style,text-decoration',
}

那些不起作用的是:
paste_text_sticky、 paste_text_sticky_default 和 valid_styles。

我基本上想做的是:

只允许
  • 文本为“粗体/斜体/下划线”
  • 列表(项目符号、数字)
  • 友情链接

  • 其他一切都是禁止的。

    你知道我做错了什么吗?非常感谢。

    最佳答案

    您需要对 paste_text_sticky 使用 Python True/False和 paste_text_sticky_default .

    TINYMCE_DEFAULT_CONFIG = {
    'theme' : 'advanced',
    'theme_advanced_buttons1' : 'bold,italic,underline,separator,bullist,numlist,separator,link,unlink',
    'theme_advanced_buttons2' : '',
    'theme_advanced_buttons3' : '',
    'theme_advanced_toolbar_location' : 'top',
    'theme_advanced_toolbar_align': 'left',
    'paste_text_sticky': True,
    'paste_text_sticky_default' : True,
    'valid_styles' : 'font-weight,font-style,text-decoration',
    }

    看看这个 Stack Overflow post与有效的 child 和风格有关。希望能帮到你。

    关于Django-TinyMCE : How to configure it properly?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12314968/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com