Description
openedon Feb 14, 2018
Steps to reproduce
- Starting at URL: https://wordpress.com/post
- Create a new post, and use the [code] shortcode to add this code:
<div data-spotim-module="recirculation" data-spot-id="sp_XXXXXXXX"></div>
<script src="https://randomdomain.com/spot/sp_XXXXXXXX"></script>
<script src="https://randomdomain.com/deferred/bundle.js" data-spotim-module="deferred-launcher" data-spot-id="sp_XXXXXXXX" data-post-id="POST_ID_HERE"></script>
- Publish the post.
What I expected
For the published post to display the code exactly as I entered it, but using the syntax highlighter.
What happened instead
All the code was stripped out, and all that appeared in the post were an empty div-tag with no attributes.
If I leave the editor, and then edit the post again, the code has disappeared from the editor as well...
...while in the HTML view in the editor the post content has changed to:
<div></div>
<pre>
[/code]
I was also able to replicate this using only an empty div-tag with the draggable and tabindex attributes (did a random spot-check). Using an id and style attribute on an empty div works correctly, so it looks like the attributes might be causing a problem here.
If I tried using only the script tags in the example code they were also stripped out and the published post contained an empty code block.
Changing the syntax highlighter language does not appear to make a difference.
The same code embeds fine if added via the WP-Admin editor, but the moment the post is updated in Calypso the same thing happens.
Context / Source
Reported by a user in 890602-f

