我使用/測試django-cms(2.3.5)+基於bootstrap的模板。 使用Django,TinyMCE的我添加代碼:django-tinymce刪除bootstrap HTML代碼
<a class="carousel-control right" href="#this-carousel-id" data-slide="next">›</a>
但Django的TinyMCE的刪除 「數據滑=」 下一步 「」
<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"
}
工作流程:
- 我打開HTML彈出
- 我複製代碼
- 我重新打開彈出式窗口,想要的代碼是有
- 我保存頁面,我重新打開彈出窗口,代碼已經改變!
我該如何避免這種行爲?
我還添加了保留空格/製表符/註釋/的選項,以保持絕對路徑,但/ static/images/path /始終轉換爲../../../../。 。/靜態的/*。
我必須檢查/更改什麼?
謝謝!
https://github.com/divio/django-cms/issues/1529變化。好的,因此唯一的解決方案是創建我自己的插件? – Daviddd