From bcf71c332ca77efe5599c0da2f140994f8a013ff Mon Sep 17 00:00:00 2001 From: "heikki@netscape.com" Date: Fri, 22 Mar 2002 22:58:36 +0000 Subject: [PATCH] Bug 130045, make marked-section-like constructs close on greater than so that content generated by MS Word and some other tools works as expected. r=harishd, sr=vidur, a=asa. --- htmlparser/src/nsHTMLTokens.cpp | 7 ++++--- parser/htmlparser/src/nsHTMLTokens.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htmlparser/src/nsHTMLTokens.cpp b/htmlparser/src/nsHTMLTokens.cpp index e4fce8c5adb4..0ee9b3e17e32 100644 --- a/htmlparser/src/nsHTMLTokens.cpp +++ b/htmlparser/src/nsHTMLTokens.cpp @@ -825,11 +825,12 @@ nsresult CCDATASectionToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt3 mTextValue.Append(aChar); result=aScanner.Peek(aChar); //then see what's next. if((NS_OK==result) && (kRightSquareBracket==aChar)) { - result=aScanner.GetChar(aChar); //strip off the second ] + result=aScanner.GetChar(aChar); //strip off the second ] mTextValue.Append(aChar); - result=aScanner.Peek(aChar); //then see what's next. } - if((NS_OK==result) && (kGreaterThan==aChar)) { + nsAutoString dummy; // skip any bad data + result=aScanner.ReadUntil(dummy,kGreaterThan,PR_FALSE); + if (NS_OK==result) { result=aScanner.GetChar(aChar); //strip off the > done=PR_TRUE; } diff --git a/parser/htmlparser/src/nsHTMLTokens.cpp b/parser/htmlparser/src/nsHTMLTokens.cpp index e4fce8c5adb4..0ee9b3e17e32 100644 --- a/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/parser/htmlparser/src/nsHTMLTokens.cpp @@ -825,11 +825,12 @@ nsresult CCDATASectionToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt3 mTextValue.Append(aChar); result=aScanner.Peek(aChar); //then see what's next. if((NS_OK==result) && (kRightSquareBracket==aChar)) { - result=aScanner.GetChar(aChar); //strip off the second ] + result=aScanner.GetChar(aChar); //strip off the second ] mTextValue.Append(aChar); - result=aScanner.Peek(aChar); //then see what's next. } - if((NS_OK==result) && (kGreaterThan==aChar)) { + nsAutoString dummy; // skip any bad data + result=aScanner.ReadUntil(dummy,kGreaterThan,PR_FALSE); + if (NS_OK==result) { result=aScanner.GetChar(aChar); //strip off the > done=PR_TRUE; }