Currently HTML Tidy is changing any empty HTML tag and combining them into one, for example:
目前,HTML Tidy正在更改任何空的HTML标记并将它们合并为一个,例如:
<script src="somescript.js"></script>
Turns into:
<script src="somescript.js" />
This is a problem because including javascript files in the "head" of my HTML is now not working in some browser that explicitly need this closing tag to be separate from the opening tag.
这是一个问题,因为在我的HTML“head”中包含javascript文件现在无法在某些明确需要此结束标记与开始标记分开的浏览器中工作。
How can I stop Tidy from removing these closing tags?
如何阻止Tidy删除这些结束标签?
2 个解决方案
#1
Try sticking some content inside the <script>
element, content that won't upset the browser, but which will prevent Tidy from collapsing the tags. Something like whitespace, or a
, or a javascript comment.
尝试在
#2
Have you defined a DOCTYPE for your HTML?
您是否为HTML定义了DOCTYPE?
Wrapping the close tag into a single tag should work for valid Xhtml, but might upset ye olde html.
将close标记包装到单个标记中应该适用于有效的Xhtml,但可能会使你的html感到不安。
#1
Try sticking some content inside the <script>
element, content that won't upset the browser, but which will prevent Tidy from collapsing the tags. Something like whitespace, or a
, or a javascript comment.
尝试在
#2
Have you defined a DOCTYPE for your HTML?
您是否为HTML定义了DOCTYPE?
Wrapping the close tag into a single tag should work for valid Xhtml, but might upset ye olde html.
将close标记包装到单个标记中应该适用于有效的Xhtml,但可能会使你的html感到不安。