配置 tidy 来转义未知的 xml 标签

发布于 2024-09-07 01:38:31 字数 438 浏览 3 评论 0原文

我正在使用 tidy 使用户输入的 HTML 格式良好,并且我已将 tidy 配置为仅接受少数 html 标签。有没有一种方法可以告诉 tidy 对未知的 xml 标签进行转义序列。下面给出了示例输入和预期输出

- 输入::


这是一段


<未知标签>未知标签中的文本

预期结果::


这是一个段落


&lt;***未知标签*&gt;未知标签中的文本&lt; /未知标签&gt;**

此致, 克沙夫

I am using tidy to make HTML entered by the user well-formed and i have configured tidy to accept only few html tags. Is there a way i can tell tidy to escape sequence the xml tags that are not known. Example input and the expected output are given below-

Input::

<div>

<p>this is a paragraph</p>

<unknown-tag>text in unknown tag</unknown-tag>

<div>

Expected out::

<div>

<p>this is a paragraph</p>

<***unknown-tag*>text in unknown tag</unknown-tag>**

<div>

Best Regards,
Keshav

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

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

发布评论

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

评论(1

赠我空喜 2024-09-14 01:38:31

我也已将这个问题发布到整洁论坛,但目前似乎还没有办法做到这一点。

BR,
克沙夫

i have also posted this question to tidy forum's and seems there is not way as of now to do this.

BR,
Keshav

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