gpt4 book ai didi

javascript - TinyMCE getContent 给出编码的 URL

转载 作者:行者123 更新时间:2023-12-03 12:23:12 27 4
gpt4 key购买 nike

我有一个带有 TinyMCE 文本区域的页面,用于接受一些输入。当用户输入类似

的内容时
#WorldCupRio http://www.ball.com/us/experience?story=hello&city=panama

我做了一个

jTextarea.tinymce().getContent()

在上面,我得到了类似的内容

#WorldCupRio http://www.ball.com/us/experience?story=hello&city=panama

& 被编码为

&

如何避免使用 & 或任何其他特殊字符进行这种编码?请帮忙。

最佳答案

这实际上应该在编辑器的初始化阶段进行设置。

tinyMCE.init({
entity_encoding: "raw",
editor_selector: "tinyMCE",
relative_urls : false,
convert_urls : false
// other config ...
}

您可以查看TinyMce configuration

更新:事实证明,根据entity_encoding config ,不可能将 < > & ' 和 "保留为原始实体。因此,我的看法是使用 replace 来取回这些原始实体。

关于javascript - TinyMCE getContent 给出编码的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24346902/

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