facebookarchive / facebook-instant-articles-sdk-php

The Facebook Instant Articles SDK for PHP provides a native interface for creating and publishing Instant Articles.
https://instantarticles.fb.com/
Other
232 stars 148 forks source link

Now cloning elements only in the right rules (interactive, ads, analy… #310

Closed mburak closed 6 years ago

mburak commented 6 years ago

…tics)

This PR changes the logic in a way that now we only clone the embeds/iframe for only the right elements (Interactive, Ads, Analytics, SocialEmbeds).

This fixes the xpath element evaluation that wasn't working when a rule had selectors with comma.

pestevez commented 6 years ago

Hey @mburak, thanks for this! How hard will it be to add some unit tests?

mburak commented 6 years ago

Hey @pestevez, @everton-rosario, I added tests for comma selectors and missing rules (ads, analytics). Let me know what do you think.

pestevez commented 6 years ago

Just a small caveat: since the original issue was uncovered using the GlobalRule and this PR fixes it, can you please include a test where this rule is also used? I think tweaking any of the existing selectors in file global-rules.json would do it. Thanks again!

mburak commented 6 years ago

Done!

diegoquinteiro commented 6 years ago

Thanks for the regression tests!