Skip to content

Commit

Permalink
Merge branch '2.1' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 17, 2023
2 parents 4ab0da2 + b77e955 commit a6c04d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_ssmedia.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions client/src/entwine/TinyMCE_ssmedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const filter = 'img[data-shortcode="image"]';
});

editor.on('GetContent', (o) => {
const content = jQuery(o.content);
const content = jQuery(`<div>${o.content}</div>`);

// Transform [image] shortcodes
content.find(filter)
Expand Down Expand Up @@ -129,13 +129,13 @@ const filter = 'img[data-shortcode="image"]';
el.replaceWith(shortCode);
});

// Insert outerHTML in order to retain all nodes incl. <script>
// Insert innerHTML in order to retain all nodes incl. <script>
// tags which would've been filtered out with jQuery.html().
// Note that <script> tags might be sanitized separately based on editor config.
o.content = '';
content.each(function () {
if (this.outerHTML !== undefined) {
o.content += this.outerHTML;
if (this.innerHTML !== undefined) {
o.content += this.innerHTML;
}
});
});
Expand Down

0 comments on commit a6c04d3

Please sign in to comment.