improvements to entity parsing and viewing

git-svn-id: svn://10.0.0.236/trunk@15159 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1998-11-23 08:01:14 +00:00
parent e9708a17e4
commit ef03ca1113
6 changed files with 52 additions and 38 deletions

View File

@@ -3371,22 +3371,22 @@ CNavDTD::ConsumeStartTag(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
*/
nsresult
CNavDTD::ConsumeEntity(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
PRUnichar ch;
nsresult result=aScanner.GetChar(ch);
PRUnichar theChar;
nsresult result=aScanner.GetChar(theChar);
if(NS_OK==result) {
if(nsString::IsAlpha(ch)) { //handle common enity references &xxx; or &#000.
if(nsString::IsAlpha(theChar)) { //handle common enity references &xxx; or &#000.
aToken = gTokenRecycler.CreateTokenOfType(eToken_entity,eHTMLTag_entity,gEmpty);
result = aToken->Consume(ch,aScanner); //tell new token to finish consuming text...
result = aToken->Consume(theChar,aScanner); //tell new token to finish consuming text...
}
else if(kHashsign==ch) {
else if(kHashsign==theChar) {
aToken = gTokenRecycler.CreateTokenOfType(eToken_entity,eHTMLTag_entity,gEmpty);
result=aToken->Consume(0,aScanner);
}
else {
//oops, we're actually looking at plain text...
nsAutoString temp("&");
temp.Append(ch);
aScanner.PutBack(theChar);
result=ConsumeText(temp,aScanner,aToken);
}
}//if