diff --git a/src/Pass/FacebookNonIframeTransformPass.php b/src/Pass/FacebookNonIframeTransformPass.php index 49778e16..37200cd6 100644 --- a/src/Pass/FacebookNonIframeTransformPass.php +++ b/src/Pass/FacebookNonIframeTransformPass.php @@ -136,11 +136,18 @@ protected function getFacebookEmbedAttrs(DOMQuery $el) $height = $card ? self::DEFAULT_HEIGHT_WITH_CARD : self::DEFAULT_HEIGHT; } - return [ + $attrs = [ 'data-href' => $src, 'data-embed-as' => $embed_as, 'height' => $height, 'width' => $width ]; + + // Set locale if exists. + if (!empty($el->attr('data-locale'))) { + $attrs['data-locale'] = $el->attr('data-locale'); + } + + return $attrs; } } 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 519996e8..661fa1bd 100644 --- a/tests/test-data/fragment-html/facebook-non-iframe-fragment.html +++ b/tests/test-data/fragment-html/facebook-non-iframe-fragment.html @@ -48,4 +48,13 @@ class="fb-xfbml-parse-ignore">Posted by Mark Zuckerberg on Wednesday, September 14, 2011 + + +
Posted by Mark Zuckerberg on Wednesday, + September 14, 2011
Posted by Mark Zuckerberg on Wednesday, +Line 59: September 14, 2011+Line 60: