Skip to content
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

Fix invalid property class name parsing #250

Merged
merged 3 commits into from Mar 8, 2024

Conversation

gRegorLove
Copy link
Member

The nestedMfPropertyNamesFromClass method was parsing property classes regardless if they were valid (e.g. p-4). Updated the method to use existing mfNamesFromClass method, which uses the correct regex to skip those classes.

Also fixed a test for nestedMfPropertyNamesFromClass which asserted the response array was equal. The expected and actual response array had the same values, but in different order. The order is not important in that response, so I switched the assertion to assertEqualsCanonicalizing.

This also appeared to fix #246, so I added a test to confirm that.

Fixes #249
Fixes #246

@gRegorLove
Copy link
Member Author

Note there's still three "risky" tests that don't perform assertions. I didn't update those in this PR but can in a subsequent one.

@sknebel
Copy link
Member

sknebel commented Oct 11, 2023

LGTM, matches what I expect, but would like second review from someone deeper in PHP

@gRegorLove
Copy link
Member Author

Added an additional test that @sknebel provided:

<div class=" h-5 pt-2">
	<div class="p-4 h-entry">
		<a class="u-url" href="https://example.com/bar">bar </a>
	</div>
	<div class="p-4 h-entry">
		<a class="u-url" href="https://example.com/foo">foo</a>
	</div>
</div>

Parsed empty on http://php.microformats.io/?id=20231011231942570

@gRegorLove gRegorLove merged commit 2753c22 into microformats:main Mar 8, 2024
5 checks passed
@gRegorLove gRegorLove mentioned this pull request Mar 8, 2024
@gRegorLove gRegorLove deleted the dev/issue249 branch March 9, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants