Problem
extractHtmlAttr in formatter.zig uses pos + attr_name.len < tag_inner.len as the loop bound. This is off by one — if an attribute name starts at the last valid position, the loop terminates before checking it. For example, a tag like <a href="url"> where href ends exactly at the boundary would fail to match.
Additionally, whitespace checks use manual character comparisons (!= ' ' and != '\t' and != '\n') instead of the standard library's std.ascii.isWhitespace, missing characters like \r.
Fix
- Changed loop bound to
<=
- Replaced manual whitespace checks with
std.ascii.isWhitespace
References
Fixed in PR #7 (commit 1e12dd1).
Problem
extractHtmlAttrinformatter.zigusespos + attr_name.len < tag_inner.lenas the loop bound. This is off by one — if an attribute name starts at the last valid position, the loop terminates before checking it. For example, a tag like<a href="url">wherehrefends exactly at the boundary would fail to match.Additionally, whitespace checks use manual character comparisons (
!= ' ' and != '\t' and != '\n') instead of the standard library'sstd.ascii.isWhitespace, missing characters like\r.Fix
<=std.ascii.isWhitespaceReferences
Fixed in PR #7 (commit 1e12dd1).