-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate properties #61
Comments
Interesting find. I think this is somewhat intentional since properties can be multi-valued, allowing publishers to put the same property on different elements, e.g. multi-photo posts: <div class="h-entry">
<img src="/photo1.jpg" class="u-photo">
<img src="/photo2.jpg" class="u-photo">
</div> I think a case could be made for de-duplicating class names on an individual element before following the parsing rules. A case could also be made that keeping the parsed duplicate will help publishers find likely mistakes in their markup. I don't have a strong opinion currently. De-duplication in the spec could look something like: "parse a child element class for property class name(s) " It would need to be precise about the normalization process:
That's just off the top of my head. There's probably an HTML spec to reference for more precision on this. This would change your example into this before parsing the <div class="h-test">
<div class="p-name u-name">W</div>
</div> |
Yes, I meant specifically the same property element, not the same microformat (where multiple of the same property on different elements is absolutely expected).
There is, yes. It's not complicated, though it performs no deduplication itself; the salient detail is really the reference to splitting on whitespace, which in turn references the definition of whitespace. Note that the same logic should be used in evaluating link relations (both are
I don't, either, for what it's worth. I do feel it needs to be specified one way or the other, though. |
Currently if an element has two or more of the same property, all major parsers add the property multiple times:
While it's good that implementations are consistent with each other, this is unfortunately inconsistent with other aspects of parsing:
vcard fn
andvevent summary
map top-name
)Do we want to deduplicate properties in v2 processing? If yes, how would collisions involving different prefixes be resolved? In my implementation I had implemented a simple ranking system with
e-
winning overu-
winning overdt-
winning overp-
, before I realized other implementations did nothing at all to resolve the duplication.Either way I intend to write tests to cover this.
The text was updated successfully, but these errors were encountered: