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 +
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:+Line 33: Transformations made from HTML tags to AMP custom tags @@ -47,6 +56,9 @@ Transformations made from HTML tags to AMP custom tagsLive from our Townhall Q&A in Rome. Comment to ask a question!
Posted by Mark Zuckerberg on Monday, August 29, 2016 +Line 32: