question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Twitter embed code not working with Trumbowyg HTML Editor

See original GitHub issue

Informations

I am Bhavana C. I have been using Trumbowyg HTML Editor and have really loved the way it is designed. We are a team related to Movies and we have many content related to Social Media to be edited in the textarea. I am facing a small issue only with twitter embed code which is added fine in the first go but if the content is tried to edit again it disappears fas the twitter code is replaced by <iframe> or <twitterwidget> tag.

Browser version: Google Chrome OS: Windows Screen resolution:

How to reproduce the bug?

  1. Enter this embed code to code view: <blockquote class="twitter-tweet"><p lang="et" dir="ltr">Azhake Azhake : <a href="https://twitter.com/hashtag/Neerali?src=hash&amp;ref_src=twsrc%5Etfw">#Neerali</a> video song <a href="https://t.co/MVOimtW1fy">https://t.co/MVOimtW1fy</a></p>— Mohanlal (@Mohanlal) <a href="https://twitter.com/Mohanlal/status/1003617901314621441?ref_src=twsrc%5Etfw">June 4, 2018</a></blockquote>

Above code is rendered as:

Azhake Azhake : #Neerali video song https://t.co/MVOimtW1fy

— Mohanlal (@Mohanlal) June 4, 2018
  1. Toggle code view back to WYSIWYG view.
  2. You can view the embed result there.
  3. Toggle back to code view, you’ll find that the twitter embed code automatically convert to
`<p>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</p><twitterwidget class="twitter-tweet twitter-tweet-rendered" id="twitter-widget-0" style="position: static; visibility: visible; display: block; transform: rotate(0deg); max-width: 100%; width: 500px; min-width: 220px; margin-top: 10px; margin-bottom: 10px;" data-tweet-id="1003617901314621441"></twitterwidget>`
  1. Go back to WYSIWYG view and you’ll find the twitter embed fail to view due to not working code/converted code.

I see that the blockquotes in the first embed code are replaced with <twitterwidget> tag. Is this intentional? Can we not retain the embed code pasted in the first instance. Can you please let me know how to fix this issue as we have lot of embed work for twitter needed for our developmental work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bhavanac24commented, Aug 16, 2019

Thanks Alex. As a workaround I am not loading the Twitter script while embedding and calling it only when displaying the tweet.

Could you explain how you achieve that please ?

When you are embedding the tweet, make sure you do not include the twitter script tag. Use the Twitter script code only when you are rendering your UI.

Do not include <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> while embedding your tweet.

1reaction
bhavanac24commented, Oct 19, 2018

Thanks Alex. As a workaround I am not loading the Twitter script while embedding and calling it only when displaying the tweet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

People who like "Issue #793 - Twitter embed code not working with ...
Issue #793 - Twitter embed code not working with Trumbowyg HTML Editor. “Issue #793 - Twitter embed code not working with Trumbowyg HTML...
Read more >
The Twitter HTML Embed code isn't working completely
I am using it for a site on wix. However, despite changing the code to have "noscrollbar", there is still a scroll bar!...
Read more >
#Trumbowyg - Twitter Search / Twitter
#Trumbowyg has reach 3000 ☆ Trumbowyg is my lightweight WYSIWYG HTML editor: ... is a lightweight #WYSIWYG editor you can embed into your...
Read more >
Trumbowyg - A lightweight WYSIWYG editor by Alex-D ...
A lightweight WYSIWYG editor. Light, translatable and customisable jQuery plugin. Beautiful design, generates semantic code, comes with a powerful API.
Read more >
Embed Tweet code doesn't work - Twitter Developers
We've run into the same problem, we are embedding tweets into html content on iOS and Android and it stopped working. 1 Like....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found