another fix for entities

This commit is contained in:
rickg@netscape.com
1999-03-25 01:27:41 +00:00
parent ccd3de0272
commit 01e7e472eb
6 changed files with 104 additions and 70 deletions
+2 -2
View File
@@ -532,7 +532,7 @@ nsresult nsHTMLTokenizer::ConsumeEntity(PRUnichar aChar,CToken*& aToken,nsScanne
}
else if(kHashsign==theChar) {
aToken = theRecycler->CreateTokenOfType(eToken_entity,eHTMLTag_entity);
result=aToken->Consume(0,aScanner);
result=aToken->Consume(theChar,aScanner);
}
else {
//oops, we're actually looking at plain text...
@@ -544,7 +544,7 @@ nsresult nsHTMLTokenizer::ConsumeEntity(PRUnichar aChar,CToken*& aToken,nsScanne
char cbuf[30];
nsString& theStr=aToken->GetStringValueXXX();
theStr.ToCString(cbuf, sizeof(cbuf)-1);
if(-1==NS_EntityToUnicode(cbuf)){
if((kHashsign!=theChar) && (-1==NS_EntityToUnicode(cbuf))){
//if you're here we have a bogus entity.
//convert it into a text token.
nsAutoString temp("&");