When pasting in the embed code into the text area, everything works fine. However, if a user goes to edit the shortcake (update a cover image or what have you), many of the html entities have been converted to their unicode(?) entities.
For example, this:
<a data-flickr-embed="true" href="https://www.flickr.com/photos/flickr/albums/72157639858715274" title="Flickr Friday"><img src="https://farm3.staticflickr.com/2838/33797934960_4b586dbcfb_b.jpg" width="1024" height="768" alt="Flickr Friday"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
We have a shortcode registered via the UI that allows users to embed Flickr galleries in posts. The UI is registered like so below:
When pasting in the embed code into the text area, everything works fine. However, if a user goes to edit the shortcake (update a cover image or what have you), many of the html entities have been converted to their unicode(?) entities.
For example, this:
<a data-flickr-embed="true" href="https://www.flickr.com/photos/flickr/albums/72157639858715274" title="Flickr Friday"><img src="https://farm3.staticflickr.com/2838/33797934960_4b586dbcfb_b.jpg" width="1024" height="768" alt="Flickr Friday"></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>
Becomes this:
<a data-flickr-embed="true" href="https://www.flickr.com/photos/flickr/albums/72157639858715274" title="Flickr Friday"><img src="https://farm3.staticflickr.com/2838/33797934960_4b586dbcfb_b.jpg" width="1024" height="768" alt="Flickr Friday"></a><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20async%20src%3D%22%2F%2Fembedr.flickr.com%2Fassets%2Fclient-code.js%22%20charset%3D%22utf-8%22%3E%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<script>" title="<script>" />
Obviously, stripping the
<script>
tags prevents the embed from working properly.Does anyone know how to ensure that the text area preserves the code as originally pasted? Is this a Wordpress issue perhaps?