sheadawson / silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views.
MIT License
48 stars 36 forks source link

Bug: SilverStripe embed shortcode stripped out of content #41

Closed satrun77 closed 7 years ago

satrun77 commented 8 years ago

If you have youtube embed in the content

<p class="large">[embed width="480" height="270" class="leftAlone" thumbnail="https://i.ytimg.com/vi/MFw9A_sl8YE/hqdefault.jpg?r=63444"]http://www.youtube.com/watch?v=MFw9A_sl8YE[/embed]</p>

This get replaced with the image placeholder on form submit. The submitted content is:

<p class="large"><img class="leftAlone ss-htmleditorfield-file embed" src="https://i.ytimg.com/vi/MFw9A_sl8YE/hqdefault.jpg?r=63444" width="480" height="270" data-captiontext="" data-url="http://www.youtube.com/watch?v=MFw9A_sl8YE" data-thumbnail="https://i.ytimg.com/vi/MFw9A_sl8YE/hqdefault.jpg?r=63444" data-width="480" data-height="270" data-cssclass="leftAlone" /></p>

This happens in these 2 lines. https://github.com/sheadawson/silverstripe-shortcodable/blob/master/javascript/shortcodable.js#L36,L37