зеркало из https://github.com/mozilla/pjs.git
small parser improvements to handle bad quotes better
This commit is contained in:
Родитель
c024a29f60
Коммит
d16a0cc944
|
@ -3146,7 +3146,7 @@ CNavDTD::ConsumeAttributes(PRUnichar aChar,CScanner& aScanner,CStartToken* aToke
|
|||
CAttributeToken* theToken= (CAttributeToken*)gTokenRecycler.CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,gEmpty);
|
||||
if(theToken){
|
||||
result=theToken->Consume(aChar,aScanner); //tell new token to finish consuming text...
|
||||
|
||||
|
||||
//Much as I hate to do this, here's some special case code.
|
||||
//This handles the case of empty-tags in XML. Our last
|
||||
//attribute token will come through with a text value of ""
|
||||
|
|
|
@ -731,9 +731,13 @@ PRInt32 ConsumeQuotedString(PRUnichar aChar,nsString& aString,CScanner& aScanner
|
|||
switch(aChar) {
|
||||
case kQuote:
|
||||
result=aScanner.ReadUntil(aString,kQuote,PR_TRUE);
|
||||
if(kNoError==result)
|
||||
aScanner.SkipOver(kQuote); //this code is here in case someone mistakenly adds multiple quotes...
|
||||
break;
|
||||
case kApostrophe:
|
||||
result=aScanner.ReadUntil(aString,kApostrophe,PR_TRUE);
|
||||
if(kNoError==result)
|
||||
aScanner.SkipOver(kApostrophe); //this code is here in case someone mistakenly adds multiple apostrophes...
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -3146,7 +3146,7 @@ CNavDTD::ConsumeAttributes(PRUnichar aChar,CScanner& aScanner,CStartToken* aToke
|
|||
CAttributeToken* theToken= (CAttributeToken*)gTokenRecycler.CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,gEmpty);
|
||||
if(theToken){
|
||||
result=theToken->Consume(aChar,aScanner); //tell new token to finish consuming text...
|
||||
|
||||
|
||||
//Much as I hate to do this, here's some special case code.
|
||||
//This handles the case of empty-tags in XML. Our last
|
||||
//attribute token will come through with a text value of ""
|
||||
|
|
|
@ -731,9 +731,13 @@ PRInt32 ConsumeQuotedString(PRUnichar aChar,nsString& aString,CScanner& aScanner
|
|||
switch(aChar) {
|
||||
case kQuote:
|
||||
result=aScanner.ReadUntil(aString,kQuote,PR_TRUE);
|
||||
if(kNoError==result)
|
||||
aScanner.SkipOver(kQuote); //this code is here in case someone mistakenly adds multiple quotes...
|
||||
break;
|
||||
case kApostrophe:
|
||||
result=aScanner.ReadUntil(aString,kApostrophe,PR_TRUE);
|
||||
if(kNoError==result)
|
||||
aScanner.SkipOver(kApostrophe); //this code is here in case someone mistakenly adds multiple apostrophes...
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче