Bug 110544, improving comment parsing by avioding string copies and other trickery. r=harishd, sr=jst, a=asa.

This commit is contained in:
heikki@netscape.com
2002-03-16 03:03:45 +00:00
parent b262408a1f
commit d949de6f64
7 changed files with 404 additions and 370 deletions
+5 -2
View File
@@ -1169,8 +1169,11 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
case eToken_comment:
{
const nsAReadableString& commentValue = aToken->GetStringValue();
result=WriteTag(mCommentTag,commentValue,0,PR_TRUE);
nsAutoString theStr;
theStr.Assign(NS_LITERAL_STRING("<!--") +
aToken->GetStringValue() +
NS_LITERAL_STRING("-->") );
result=WriteTag(mCommentTag,theStr,0,PR_TRUE);
}
break;