Skip to content

Conversation

@Zegnat
Copy link
Member

@Zegnat Zegnat commented Mar 28, 2018

Suggest the end-user to also install masterminds/html5. If it is installed, php-mf2 will use it instead of the default DOMDocument::loadHTML.

All tests pass as normal with the alternative parser. One extra test was added that simulates the problem with the default parser. This test is skipped if masterminds/html5 isn’t installed.

@Zegnat Zegnat force-pushed the optional-html5-parser branch from dc05c7b to 2572b0c Compare March 28, 2018 11:37
@kaushalmodi
Copy link

@Zegnat

Suggest the end-user to also install masterminds/html5

If this is merged, will webmention.io, xray.p2k.io, etc. using php-mf2 start parsing the minified html5 correctly? When you say "end user", you mean the endpoint developers, right?

@Zegnat
Copy link
Member Author

Zegnat commented Mar 28, 2018

If this is merged, will webmention.io, xray.p2k.io, etc. using php-mf2 start parsing the minified html5 correctly?

That’s up to those projects. But I do think @aaronpk will be interested in running it with the alternative parser if that enables more sites to be correctly parsed!

When you say "end user", you mean the endpoint developers, right?

I mean anyone who is using the php-mf2 library to parse HTML. Those can be public endpoints and services, or just a WordPress plugin that happens to rely on the parser.

After this merge, if you retrieve php-mf2 with Composer, it will suggest you to install masterminds/html5 as well. Of masterminds/html5 is installed, it will automatically be used, no configuration required.

Hope that explains this!

(It was done this way to keep the parser contained in one file and not ask the library user to worry about configuring HTML parsers.)

@aaronpk aaronpk added this to the 0.4.3 milestone Mar 29, 2018
@aaronpk
Copy link
Member

aaronpk commented Mar 29, 2018

Tests are passing both with and without the new html5 parser!

@aaronpk aaronpk merged commit 64aab44 into microformats:master Mar 29, 2018
@kaushalmodi
Copy link

Thanks guys! @aaronpk Does you plan to use it for webmention.io, xray.p3k.io, etc?

@aaronpk
Copy link
Member

aaronpk commented Mar 29, 2018

Yes, i will be launching it in all my apps shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants