views:

231

answers:

1

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 -->
+1  A: 

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.

cletus
In that case is there maybe another way to indent the code it's all filled with tables for layout, and as the pirate with the steering wheel in his pants said, "it's driving me nuts!"
leeand00
...Maybe I just need to move them...to...*groan*...the wrong part of the page...
leeand00