我正在使用/测试django-cms (2.3.5) +基于引导的模板。使用django-tinymce,我添加了代码:
<a class="carousel-control right" href="#this-carousel-id" data-slide="next">›</a>但是django-tinymce删除了“data-幻灯片=”next“”
<a class="carousel-control right" href="#this-carousel-id">›</a>当然什么都不起作用。
使用WYeditor,我发现无法修改settings.py中的选项。使用tinyMCE我可以:
TINYMCE_DEFAULT_CONFIG={
# General options
'mode': "textareas",
'theme': "advanced",
'remove_linebreaks': "false",
'convert_urls': "false",
'relative_urls': "false",
'theme_advanced_resizing': "true",
'paste_auto_cleanup_on_paste': "true",
#'preformatted': "true",
'valid_elements': "+*[*]",
'width': "100%",
'height': "300px",
'theme_advanced_buttons1' : "formatselect,separator,bold,italic,hr,separator,link,unlink,separator,bullist,numlist,separator,undo,redo,",
'theme_advanced_buttons2' : "|,help,code,|",
'theme_advanced_buttons3' : "" ,
'theme_advanced_blockformats' : "p,h1,h2,h3,blockquote",
'theme_advanced_toolbar_location' : "top",
# Example content CSS (should be your site CSS)
#'content_css': 'css/example.css',
#'content_css' : "/media/css/tiny_editor.css"
}工作流程:
我怎样才能避免这种行为?
我还添加了保留空格/制表符/注释/保留绝对路径的选项,但是/静态/图像/路径/总是被转换为././静态/*。
我要检查/换什么?
谢谢!
发布于 2013-02-08 11:04:34
您需要将data-slide声明为链接/a-标记的有效属性。让我们看看元素的设置
发布于 2013-06-25 08:46:54
我相信字段的移除是由html5lib完成的,cms使用它作为package,您需要打开html5lib文件夹并打开sanitizer.py,在第184行中,代码如下:
if name in self.allowed_attributes])改为:
if name in self.allowed_attributes or re.match( r'data-.*',name)]) 这将允许所有数据(任何)属性。
对于WYMeditor,数据-(任何)属性已经被允许。
发布于 2014-07-10 07:47:42
“假”与“真”--论假与真
https://stackoverflow.com/questions/14757490
复制相似问题