HTML Tidy,不要移动那些评论!

发布于 2024-07-13 16:06:30 字数 995 浏览 4 评论 0原文

我正在使用 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 技术交流群。

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

发布评论

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

评论(1

场罚期间 2024-07-20 16:06:31

他们是评论。 您真的需要它们的整洁版本吗?

我在 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.

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