python 中的 org.apache.commons.lang.StringEscapeUtils

发布于 2024-08-10 20:03:49 字数 415 浏览 3 评论 0原文

是否有任何 python 模块或代码实现 org.apache.commons.lang.StringEscapeUtils.escapeHtml ?

http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)

我用谷歌搜索但只能找到cgi。转义函数不做同样的事情。

预先感谢,抱歉英语:D

is there any python module or code that implements the org.apache.commons.lang.StringEscapeUtils.escapeHtml ?

exactly the same as in http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)

i googled around but could only find the cgi.escape function that doesn't do the same thing.

thanks in advance, sorry for the english :D

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万水千山粽是情ミ 2024-08-17 20:03:49

这是针对 XML 而不是 HTML,但它可能适合您的需求:转义 XML

>>> from xml.sax.saxutils import escape
>>>
>>> escape("< & >")
'< & >'

This is for XML and not for HTML, but it might fit your needs: Escaping XML

>>> from xml.sax.saxutils import escape
>>>
>>> escape("< & >")
'< & >'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文