HTML Tidy,不要移动那些评论!
我正在使用 html-tidy,我的一些评论已从文档的头部移动到根部。 有什么办法可以避免这种行为吗?
(我正在尝试将一些非常非常糟糕的标记转换为 xhtml 投诉代码)哦,此外它还使用内部开发的半服务器端脚本语言,该语言使用注释将数据放置在 html 中,非常非常不标准...我很想彻底改变它...但你知道雇主是如何...
问题是这样的:
整理之前:
<head>
...
<!-- BODY_ON_LOAD_SECTION -->
<script type="text/javascript" language="Javascript">
function init() {
openWin('BODY_ON_LOAD_SECTION_REFERENCE','','resizable=yes,width=400,height=400,left=50,top=50');
}
</script>
<!-- END_BODY_ON_LOAD_SECTION -->
</head>
整理之后:
<script type="text/javascript" language="Javascript">
function init() {
openWin('BODY_ON_LOAD_SECTION_REFERENCE','','resizable=yes,width=400,height=400,left=50,top=50');
}
</script>
</head><!-- BODY_ON_LOAD_SECTION --> <!-- END_BODY_ON_LOAD_SECTION -->
I was working with html-tidy and a couple of my comments were moved from the head to the root of the document. Is there anyway to avoid this behavior?
(I'm trying to turn some really really bad markup into xhtml complaint code) Oh and additionally it uses an in-house developed semi-server-side scripting language that uses comments to place data within the html, very, very non-standard... I'd love to completely change it over...but you know how employers are...
Here is the problem:
Before Tidy:
<head>
...
<!-- BODY_ON_LOAD_SECTION -->
<script type="text/javascript" language="Javascript">
function init() {
openWin('BODY_ON_LOAD_SECTION_REFERENCE','','resizable=yes,width=400,height=400,left=50,top=50');
}
</script>
<!-- END_BODY_ON_LOAD_SECTION -->
</head>
After Tidy:
<script type="text/javascript" language="Javascript">
function init() {
openWin('BODY_ON_LOAD_SECTION_REFERENCE','','resizable=yes,width=400,height=400,left=50,top=50');
}
</script>
</head><!-- BODY_ON_LOAD_SECTION --> <!-- END_BODY_ON_LOAD_SECTION -->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们是评论。 您真的需要它们的整洁版本吗?
我在 tidy 中看到的与评论相关的唯一两个 选项 是隐藏它们并修复不好的内容评论,所以你可能会不走运。
They're comment. Do you really need them in the tidy version?
The only two options I see in tidy that relate to comments are hiding them and fixing bad comments so you may be out of luck.