humanmade / Simple-Instant-Articles-for-Facebook

Add support for Facebook Instant Articles to your WordPress site.
7 stars 0 forks source link

Try and fix youtube #60

Closed mattheu closed 8 years ago

mattheu commented 8 years ago

FB doesn't seem to like our markup. There are a few differences I've noticed from ours, the documentation, and other feeds

  1. Our embeds are wrapped in a div or span with the class like embed-. We can fairly easily unwrap these using.
  2. We're left with something like the following. <iframe><iframe src="">. I don't think this is 100% necessary, and the video will render full width if we can strip the outer iframe. However we can only do this if the embed uses an iframe, and not if using scripts and other markup, so I'm quite strict about checking this is the only element.
dashaluna commented 8 years ago

I know ;) but down the line say 6 months, it's just clearer to see what we're doing and that $node is either div or span rather than going back to the xpath.

mattheu commented 8 years ago

OK - I think we can reuse the code for unwrap so i've moved to a separate method and added better documentation. I think its much neater now. Thanks ;)

mattheu commented 8 years ago

Oh oops you merged ;) Was still fixing your comments ;)