diff --git a/htmlparser/src/nsHTMLTokenizer.cpp b/htmlparser/src/nsHTMLTokenizer.cpp index 5203dab1d4e4..d6dd2eaba701 100644 --- a/htmlparser/src/nsHTMLTokenizer.cpp +++ b/htmlparser/src/nsHTMLTokenizer.cpp @@ -504,7 +504,10 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner& result=aScanner.Peek(theNextChar, 1); if(NS_OK==result) { - if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)) { + // xml allow non ASCII tag name, consume as end tag. need to make xml view source work + PRBool isXML=((eXMLText==mDocType) || (eXHTMLText==mDocType)); + if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)|| + (isXML && (! nsCRT::IsAscii(theNextChar)))) { result=ConsumeEndTag(aChar,aToken,aScanner); } else result=ConsumeComment(aChar,aToken,aScanner); diff --git a/parser/htmlparser/src/nsHTMLTokenizer.cpp b/parser/htmlparser/src/nsHTMLTokenizer.cpp index 5203dab1d4e4..d6dd2eaba701 100644 --- a/parser/htmlparser/src/nsHTMLTokenizer.cpp +++ b/parser/htmlparser/src/nsHTMLTokenizer.cpp @@ -504,7 +504,10 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner& result=aScanner.Peek(theNextChar, 1); if(NS_OK==result) { - if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)) { + // xml allow non ASCII tag name, consume as end tag. need to make xml view source work + PRBool isXML=((eXMLText==mDocType) || (eXHTMLText==mDocType)); + if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)|| + (isXML && (! nsCRT::IsAscii(theNextChar)))) { result=ConsumeEndTag(aChar,aToken,aScanner); } else result=ConsumeComment(aChar,aToken,aScanner);