TinyMCE在Umbraco中清理HTML [英] TinyMCE scrubbing HTML in Umbraco
问题描述
我试图在Umbraco中使用Bootstrap的 collapse
功能,但是当我在富文本编辑器(TinyMCE)中编辑页面的HTML时,<$ c当我保存页面时,$ c> data - 属性会被删除,所以插件不起作用。我跟着在tinymce编辑器中允许任何标记不起作用。我可以停止TinyMCE擦洗我的HTML吗?
I'm trying to use Bootstrap's collapse
functionality in Umbraco, but when I edit the HTML of a page in the rich text editor (TinyMCE), the data-
attributes are scrubbed when I save the page so the plugin doesn't work. I've followed Allow any markup in the tinymce editor with no effect. Can I stop TinyMCE scrubbing my HTML?
编辑:我已经在 http://fiddle.tinymce.com/BNcaab
尝试将以下代码粘贴到HTML编辑器,然后保存并再次点击HTML编辑器。
Try pasting the code below into the HTML editor, then saving and clickig the HTML editor again.
<a class="accordion-toggle down" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
<h4>Slide 1</h4>
<span class="accordion-arrow"></span>
</a>
推荐答案
Umbraco在保存/发布事件后运行TidyHtml,不幸的是,与tinyMCE valid / invalid_elements并不是100%的sysnc。有许多HTML5元素和属性被丢弃,我相信一些其他基本元素,如< scripts> (这是更好,我说!)和< iframes> ;.我不记得整齐的元素的确切列表,但是这是我们在最新的Umbraco 4.8.11实现中碰到的一个问题,不幸的是不得不求助于整理。
使用以下命令可以在[/config/umbracoSettings.config]中禁用Tidy:
Umbraco has TidyHtml run after a save/publish event and unfortunately doesn't 100% sysnc with the tinyMCE valid/invalid_elements. There are a number of html5 elements and attributes that get discarded and i believe some other basic elements like <scripts> (this is for the better, i say!) and <iframes>. I can't remember the exact list of elements that tidy will squash, but this is a problem that we ran into on our latest Umbraco 4.8.11 implementation and unfortunately had to resort to disabling tidy. Disabling Tidy can be done in the [/config/umbracoSettings.config] with the following:
<!-- clean editor content with use of tidy -->
<TidyEditorContent>False</TidyEditorContent> <!-- gross but: http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/allow-any-markup-in-the-tinymce-editor -->
这篇关于TinyMCE在Umbraco中清理HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!