Skip to content

Commit

Permalink
Merge pull request #58 from Neumes/3.0
Browse files Browse the repository at this point in the history
FIX (before submit): save html content to textarea before shortcode change
  • Loading branch information
sheadawson authored Jul 11, 2017
2 parents 28bc6a3 + 6e02888 commit 8fa191f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascript/shortcodable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
*/
'from .cms-edit-form': {
onbeforesubmitform: function(e) {
// Save the updated content here, rather than _after_ replacing the placeholders
// otherwise you're replacing the shortcode html with the shortcode, then writing
// the html back to the textarea value, overriding what the shortcode conversion
// process has done
this._super(e);

var shortcodable = tinyMCE.activeEditor.plugins.shortcodable;
if (shortcodable) {
var ed = this.getEditor();
Expand Down

0 comments on commit 8fa191f

Please sign in to comment.