【发布时间】:2020-10-27 18:44:18
【问题描述】:
我花了 2 天时间试图强迫 TinyMCE 不删除我的 a 标签,所有可用的设置都没有,但没有运气(也在这里查看了 20 多个帖子 - 大多数已经超过十年,没有有效的解决方案) .我只是要发布我尝试放入编辑器的内容以及它删除的内容(以及我尝试过的每个设置)。
标记应该是什么样子:
<a href="#" class="hearmorelink" onclick="window.open('/Mini-Lots-audio.html', 'Voice Over', 'width=320,height=1,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');return false;">
<div>Want to hear more?<span style="margin-top: 60px;">CLICK HERE</span></div>
</a>
tinyMCE 对它做了什么:
<div>Want to hear more?<span style="margin-top: 60px;">CLICK HERE</span></div>
也许不是有史以来最漂亮的 HTML,但为什么它不允许在 A 标记内包装任何内容,而根据 RFC 完全可以接受 HTML5?
apply_source_formatting: false,
verify_html: false,
trim_span_elements: false,
cleanup: false,
convert_urls: false,
cleanup_on_startup: false,
force_br_newlines: true,
force_p_newlines: false,
allow_script_urls: true,
forced_root_block: false,
valid_elements: '+*[*]',
plugins: [
"advlist autolink autoresize directionality lists link image charmap preview anchor",
"searchreplace visualblocks code fullscreen textcolor",
"insertdatetime media table contextmenu paste"
],
所有设置似乎都可以正常工作,但此问题仍然存在。因为这需要 50 个左右的页面,并且 HTML 是从数据库中存储和检索的,所以我无法在其中硬编码任何内容(同样 - 非 HTML 人员/管理员也需要使用它)。 我想尽办法完成这项工作(而且,是的,它必须是一个弹出窗口,以便在人们从一个页面访问到另一个页面时播放音频)。
有什么想法吗?插件?
【问题讨论】:
标签: tinymce tinymce-4 tinymce-plugins