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:
@@ -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 �.
|
||||
if(nsString::IsAlpha(theChar)) { //handle common enity references &xxx; or �.
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user