和​​ 有谁知道是否有特殊标志或选项可用? 最好的问候。 最佳答案 我有这个确切的问题,因为我想将 TinyMCE-6ren">
gpt4 book ai didi

html - 如何停止将 "greater than"和 "less than"符号转换为 TinyMCE 中的实体?

转载 作者:可可西里 更新时间:2023-11-01 13:29:50 27 4
gpt4 key购买 nike

出于某些原因,我需要在我的 TinyMCE 4.2.2 编辑器实例中按原样保存 > 和​​ < 符号。

我知道我可以将 entity_encoding 设置为 raw 但是,虽然这个选项阻止大多数符号被转换为实体,但“大于”和“小于”总是被转换为 <>

有谁知道是否有特殊标志或选项可用?

最好的问候。

最佳答案

我有这个确切的问题,因为我想将 TinyMCE 编辑器的内容视为可能包含子元素的 XML。所以如果有 <sub>3</sub>在编辑器字段中,我想将其视为 XML 元素,而不仅仅是一些文本。无论如何,这是 TinyMCE 不允许的。 TinyMCE 4.x 文档多次声明:

The base entities < > & ' and " will always be entity encoded into their named equivalents. Though ' and " will only be encoded within attribute values and < > will only be encoded within text nodes. This is correct according to the HTML and XML specifications.

参见 herehere .还有一些旧的讨论here关于这个在 TinyMCE 帮助论坛上。

结论是 TinyMCE 不允许您获得未转义的小于号或大于号,因此您必须在从 TinyMCE 取回文本后将它们从 HTML 实体代码转换回。

关于html - 如何停止将 "greater than"和 "less than"符号转换为 TinyMCE 中的实体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31705104/

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