Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
Comments (8)
@CalvinWong I am trying to reproduce this and looking into whether we can rely on
DOMDocument::saveHTML
for the output. Could you share the code that you are using to construct theFacebook\InstantArticles\Elements\SocialEmbed
instance?from facebook-instant-articles-sdk-php.
To give you some insight, we are using WordPress and the plugin 'Instant Articles for WP'. I first tracked the issue there (https://wordpress.org/support/topic/cdata-after-script-tags), before discovering it was within the Facebook Instant Articles SDK. In our WordPress instance, we have a shortcode that generates a Facebook embed. The generated embed is looks something like this:
When the filters get applied, the iframe is wrapped within the social embed figure. But in the final step, the saveXML generates a CDATA wrapper around the script tags.
from facebook-instant-articles-sdk-php.
@CalvinWong It does seem that
CDATA
is injected in a scenario as yours with the current behavior. Unfortunately, simply swapping withDOMDocument::saveHTML
would lead to other issues (essentially since the HTML format support inDOMDocument
is not really compliant with HTML5).We will find a way to work around this.
In the meantime, if you are able to modify the output from the shortcode to use an iframe embed (instead of a script), that should work fine. You can find the iframe embed code by simply clicking "Embed" on a Facebook video or post (iframe is the default embed format).
For the video in your example, the code would be:
from facebook-instant-articles-sdk-php.
@simonengelhardt Did you get a chance to check this issue?
CC @scottrigby
from facebook-instant-articles-sdk-php.
We are using embed script for all the social media embed like Instagram, Twitter and facebook as we seen issues with Iframe to make it responsive on our site. So we are waiting to get this issue solved.
from facebook-instant-articles-sdk-php.
@CalvinWong @anbarasan1985 @scottrigby Sorry about the long wait on this, but a fix is now implemented in #126. We expect to merge this in and release a new version of the SDK early next week. Feel free to test the PR in the meantime.
from facebook-instant-articles-sdk-php.
Thanks @simonengelhardt
from facebook-instant-articles-sdk-php.
I left a comment on the PR after my testing.
from facebook-instant-articles-sdk-php.
Related Issues (20)