[fixed] odd behaviour with </script>

The following patch fixes a bug in tidy which prevents it from
regognizing </script> end tags if they contain whitespace as in:
</script
>

It apparently does not screw up anything else, but I didn't test this
thoroughly.

For a test case, see my previous post:
http://lists.w3.org/Archives/Public/html-tidy/2000OctDec/0055.html

-------------------------------------------
--- lexer.c.orig	Fri Aug  4 16:21:05 2000
+++ lexer.c	Thu Oct 26 16:23:44 2000
@@ -1381,13 +1381,21 @@
         }
         else if (c == '\r')
         {
+	  if (endtag) {
+	    continue; /* discard whitespace in endtag */
+	  }
+	  else {
             c = ReadChar(lexer->in);
 
             if (c != '\n')
                 UngetChar(c, lexer->in);
 
             c = '\n';
+	  }
         }
+	else if ((c == '\n' || c == '\t' || c == ' ') && endtag) {
+	  continue; /* discard whitespace in endtag */
+	}
 
         AddCharToLexer(lexer, (uint)c);
         lexer->txtend = lexer->lexsize;
-------------------------------------------

regards,
Markus

-- 
Markus Hoenicka, PhD
UT Houston Medical School
Dept. of Integrative Biology and Pharmacology
6431 Fannin MSB4.114
Houston, TX 77030
(713) 500-6313, -7477
(713) 500-7444 (fax)
Markus.Hoenicka@uth.tmc.edu
http://ourworld.compuserve.com/homepages/hoenicka_markus/

Received on Thursday, 26 October 2000 13:09:50 UTC