You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
class and rel attributes only split on single spaces instead of ASCII whitespace, and duplicate h-* types are kept #514
class and rel attributes are tokenized with .split(" ") instead of splitting on HTML ASCII whitespace (\t, \n, \f, \r, and space) and ignoring empty tokens. When a class or rel attribute wraps across lines or contains tabs or extra spaces, class names stick to adjacent whitespace and fail to match microformat root/property patterns, while rels and rel-urls record keys containing newlines or "". In addition, repeated h-* root classes on the same element are not deduplicated in item.type as required by the microformats2 parsing specification.
Tested on microformats-parser@2.0.6 and main (aa91899) on Node.js v26.13.0, and confirmed in the online demo at https://microformats.github.io/microformats-parser/ (which does not support URL parameters for pre-filling input).
getClassNames, hasRelIntersect, and getRelIntersect in src/helpers/attributes.ts and parseRel in src/rels/rels.ts call .split(" ") without filtering empty strings, and getMicroformatType in src/microformats/parse.ts sorts h-* class names without deduplicating them (also covered in microformat-tests under tests/microformats-v2-unit/names/, which test/scenarios.spec.ts does not load yet).
Activity