Issue #395 - a potential fix

This commit is contained in:
Geoff McLane 2017-05-21 01:47:36 +02:00
parent ec03beb361
commit c9c1d7ae55
1 changed files with 16 additions and 0 deletions

View File

@ -3723,6 +3723,22 @@ static tmbstr ParseAttribute( TidyDocImpl* doc, Bool *isempty,
if (TY_(IsWhite)(c))
break;
if (c == '/') /* Issue #395 - potential self closing tag */
{
c = TY_(ReadChar)(doc->docIn); /* read next */
if (c == '>')
{
/* got a self closing tag - put is back and continue... */
TY_(UngetChar)(c, doc->docIn);
break;
}
else
{
/* Not '/>' - put it back */
TY_(UngetChar)(c, doc->docIn);
}
}
/* what should be done about non-namechar characters? */
/* currently these are incorporated into the attr name */