Tidy 如何处理自闭合标签

发布于 2024-09-16 15:12:38 字数 269 浏览 0 评论 0原文

我将 tidy 作为 gedit 中的插件运行。

它打开自闭合标签,例如

例如
转到 < ;br> 转到

我可以整理一下吗gedit 尊重这些自关闭标签,还是我不应该使用这些标签?

I run tidy as a plugin in gedit.

It uncloses self-closing tags like <br> and <img>

e.g. <br /> goes to <br> and <img src="somewhere" /> goes to <img src="somewhere">

Can I make tidy in gedit respect these self-closing tags or should I not be using these tags?

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

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

发布评论

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

评论(1

本宫微胖 2024-09-23 15:12:38

在 HTML 中,这些元素末尾不应有自闭合 /。

如果您不需要使用 XHTML(听起来您不需要),那么我将只使用 HTML 文档类型并让 Tidy 做它已经在做的事情。否则,您需要告诉 Tidy 您希望它使用 XHTML 规则而不是 HTML 规则

In HTML, those elements shouldn't have a self-closing / at the end.

If you don't need to be using XHTML (and it sounds like you don't) then I would just use an HTML doctype and let Tidy do what it's already doing. Otherwise, you need to tell Tidy that you want it to use XHTML rules instead of HTML rules

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