diff --git a/src/attrs.c b/src/attrs.c index 3eae987..13c2668 100644 --- a/src/attrs.c +++ b/src/attrs.c @@ -1856,13 +1856,19 @@ void CheckLength( TidyDocImpl* doc, Node *node, AttVal *attval) } else { + Bool percentFound = no; while (*p) { - if (!TY_(IsDigit)(*p) && *p != '%') + if (!percentFound && *p == '%') + { + percentFound = yes; + } + else if (percentFound || !TY_(IsDigit)(*p)) { TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE); break; } + ++p; } }