How Internet Explorer for Windows 6.0 recognizes comments

Hi,

  Comments start at least with <!, special cases for <!DOCTYPE, <![...,
etc.

  if ( there is an opening "--" ) /* <!-- */
    if ( finds following "-->" )  /* <!-->>>--> */
      next "-->" closes comment
    else
      next ">" closes comment     /* <!--> */
  else                            /* <!foo>, <!>, <!-foo-->, ... */
    next ">" closes comment

Improperly formed comments are not exposed through DOM.

Received on Sunday, 6 April 2003 22:05:58 UTC