From 5be8c89cb650e8492e274bbc72c8d691e8ce95d5 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sat, 21 Nov 1998 02:48:01 +0000 Subject: [PATCH] fixed bug 1125 --- htmlparser/src/nsHTMLTokens.cpp | 12 ++++++++++++ parser/htmlparser/src/nsHTMLTokens.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/htmlparser/src/nsHTMLTokens.cpp b/htmlparser/src/nsHTMLTokens.cpp index d95a0e764d1..841566861df 100644 --- a/htmlparser/src/nsHTMLTokens.cpp +++ b/htmlparser/src/nsHTMLTokens.cpp @@ -302,6 +302,18 @@ nsresult CEndToken::Consume(PRUnichar aChar, CScanner& aScanner) { char buffer[300]; mTextValue.ToCString(buffer,sizeof(buffer)-1); + + //This code was added to fix Bug#1125. + //The problem occurs in bad tags like this: . + //"font size" was being viewed as the tag, which of course doesn't exist. + //Instead, just look at the first word. + int theBufPos=-1; + while(buffer[++theBufPos]){ + if(kSpace==buffer[theBufPos]){ + buffer[theBufPos]=0; + break; + } + } mTypeID= NS_TagToEnum(buffer); if(NS_OK==result) diff --git a/parser/htmlparser/src/nsHTMLTokens.cpp b/parser/htmlparser/src/nsHTMLTokens.cpp index d95a0e764d1..841566861df 100644 --- a/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/parser/htmlparser/src/nsHTMLTokens.cpp @@ -302,6 +302,18 @@ nsresult CEndToken::Consume(PRUnichar aChar, CScanner& aScanner) { char buffer[300]; mTextValue.ToCString(buffer,sizeof(buffer)-1); + + //This code was added to fix Bug#1125. + //The problem occurs in bad tags like this: . + //"font size" was being viewed as the tag, which of course doesn't exist. + //Instead, just look at the first word. + int theBufPos=-1; + while(buffer[++theBufPos]){ + if(kSpace==buffer[theBufPos]){ + buffer[theBufPos]=0; + break; + } + } mTypeID= NS_TagToEnum(buffer); if(NS_OK==result)