Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook embedded posts not work #274

Closed
siygle opened this issue Aug 22, 2013 · 2 comments
Closed

Facebook embedded posts not work #274

siygle opened this issue Aug 22, 2013 · 2 comments
Labels
bug Something isn't working

Comments

@siygle
Copy link
Contributor

siygle commented Aug 22, 2013

Facebook provides embedded post now, but it's format like follow:

<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-post" data-href="https://www.facebook.com/photo.php?fbid=596538790367955&amp;set=a.170672256287946.33622.151274568227715&amp;type=1"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/photo.php?fbid=596538790367955&amp;set=a.170672256287946.33622.151274568227715&amp;type=1">Post</a> by <a href="https://www.facebook.com/TheBritishMonarchy">The British Monarchy</a>.</div></div>

Cause it use js directly, so it'll be encoded and do not work after generate.

I also consider tag but it has dynamic content so might not possible to implement one. Also try raw tag but it did not work like my thought. (I hope the content between raw and endraw will keep it's format, but seem it still got encoded)

Any better solution to do this? thanks

@siygle
Copy link
Contributor Author

siygle commented Aug 28, 2013

I found the root cause of this issue, I think raw tag didn't work correctly.

hexo use swig to parse and compile tag inside the post, but actually swig has a tag called raw too. So it didn't add escape tag to it, so the content will be escaped.

Can hexo change the naming of raw tag?
Just make sure it's different from those that swig's already defined. (maybe rawblock?)

tommy351 added a commit that referenced this issue Aug 29, 2013
@tommy351
Copy link
Member

Fixed in 2.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants