Merge pull request #595 from ablackton/fix/XmlElementNameParsing

Issue #594 - Parse XML element names beginning with Valid NameChar
This commit is contained in:
Geoff McLane 2017-09-20 17:02:14 +02:00 committed by GitHub
commit cd9bb76caf

View file

@ -2696,7 +2696,7 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
TY_(AddCharToLexer)(lexer, c);
if (TY_(IsLetter)(c))
if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
{
lexer->lexsize -= 3;
lexer->txtend = lexer->lexsize;
@ -2897,7 +2897,7 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
}
/* check for start tag */
if (TY_(IsLetter)(c))
if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
{
TY_(UngetChar)(c, doc->docIn); /* push back letter */
TY_(UngetChar)('<', doc->docIn);