Skip to content

Commit ef2158d

Browse files
committed
Fix percentage validation in CheckLength
Fixes #910
1 parent a2065f8 commit ef2158d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/attrs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,13 +1836,19 @@ void CheckLength( TidyDocImpl* doc, Node *node, AttVal *attval)
18361836
}
18371837
else
18381838
{
1839+
Bool percentFound = no;
18391840
while (*p)
18401841
{
1841-
if (!TY_(IsDigit)(*p) && *p != '%')
1842+
if (*p == '%')
1843+
{
1844+
percentFound = yes;
1845+
}
1846+
else if (percentFound || !TY_(IsDigit)(*p))
18421847
{
18431848
TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
18441849
break;
18451850
}
1851+
18461852
++p;
18471853
}
18481854
}

0 commit comments

Comments
 (0)