diff --git a/src/Pass/FacebookNonIframeTransformPass.php b/src/Pass/FacebookNonIframeTransformPass.php index 3750f812..392694b8 100644 --- a/src/Pass/FacebookNonIframeTransformPass.php +++ b/src/Pass/FacebookNonIframeTransformPass.php @@ -110,7 +110,7 @@ protected function getFacebookEmbedAttrs(DOMQuery $el) $card = true; // e.g https://www.facebook.com/facebook/videos/10153231379946729/ - if (preg_match('&(*UTF8)facebook\.com/facebook/videos/\d+/?&i', $src)) { + if (preg_match('&(*UTF8)facebook\.com/.*/videos/\d+/?&i', $src)) { // A facebook video can be embedded as a post. Doing that enables the video "card" to display if ($el->attr('data-show-text') !== "false") { $embed_as = 'post'; diff --git a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html index efd69dbb..87955db7 100644 --- a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html +++ b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html @@ -23,4 +23,11 @@

How to share with just friends.

Posted by Facebook on Friday, 5 December 2014 + + +
+
+ Live from our Townhall Q&A in Rome. Comment to ask a question! +

Live from our Townhall Q&A in Rome. Comment to ask a question!

Posted by Mark Zuckerberg on Monday, August 29, 2016 +
\ No newline at end of file diff --git a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out index f14d6b5c..498795df 100644 --- a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out +++ b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html.out @@ -5,6 +5,8 @@ + + ORIGINAL HTML --------------- Line 1:
@@ -33,6 +35,13 @@ Line 23:

How to share with just friends.

Posted by +Line 29:
+Line 30: Live from our Townhall Q&A in Rome. Comment to ask a question! +Line 31:

Live from our Townhall Q&A in Rome. Comment to ask a question!

Posted by Mark Zuckerberg on Monday, August 29, 2016 +Line 32:
+Line 33: Transformations made from HTML tags to AMP custom tags @@ -47,6 +56,9 @@ Transformations made from HTML tags to AMP custom tags
at line 20 ACTION TAKEN: div.fb-video facebook javascript sdk embed code was converted to the amp-facebook tag. +
at line 28 + ACTION TAKEN: div.fb-video facebook javascript sdk embed code was converted to the amp-facebook tag. + AMP-HTML Validation Issues and Fixes -------------------------------------