Minor adjustments in consuming attributes ( Tracking down '<').

git-svn-id: svn://10.0.0.236/trunk@44520 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
1999-08-25 21:27:43 +00:00
parent c65363b39c
commit 6ba9a03c27
4 changed files with 30 additions and 10 deletions

View File

@@ -331,7 +331,7 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner&
PRUnichar ch;
result=aScanner.Peek(ch);
if(NS_OK==result) {
if(nsString::IsAlpha(ch)) {
if(nsString::IsAlpha(ch)||(kGreaterThan==ch)) {
result=ConsumeEndTag(aChar,aToken,aScanner);
}
else result=ConsumeComment(aChar,aToken,aScanner);
@@ -413,9 +413,19 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,CStartToken* aToken,
result=aScanner.SkipWhitespace();
if(NS_SUCCEEDED(result)) {
result=aScanner.Peek(aChar);
if(NS_SUCCEEDED(result) && (aChar==kGreaterThan)) { //you just ate the '>'
aScanner.GetChar(aChar); //skip the '>'
done=PR_TRUE;
if(NS_SUCCEEDED(result)) {
if(aChar==kGreaterThan) { //you just ate the '>'
aScanner.GetChar(aChar); //skip the '>'
done=PR_TRUE;
}
else if(aChar==kLessThan) {
eHTMLTags theEndTag = (eHTMLTags)aToken->GetTypeID();
if(result==NS_OK&&(gHTMLElements[theEndTag].mSkipTarget)){
CToken* theEndToken=theRecycler->CreateTokenOfType(eToken_end,theEndTag);
AddToken(theEndToken,NS_OK,mTokenDeque,theRecycler);
}
done=PR_TRUE;
}
}//if
}
}//if