Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
linkesch committed Feb 27, 2016
1 parent fe002ea commit d02646e
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

2.2.2 / 2016-02-27
==================

* Fix serializing html with embed codes containing scripts

2.2.1 / 2016-02-05
==================

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medium-editor-insert-plugin",
"version": "2.2.1",
"version": "2.2.2",
"description": "jQuery insert plugin for MediumEditor",
"main": [
"dist/js/medium-editor-insert-plugin.js",
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin-frontend.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin-frontend.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions dist/js/medium-editor-insert-plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down Expand Up @@ -274,6 +274,12 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl

$data.find('.medium-insert-buttons').remove();

// Restore original embed code from embed wrapper attribute value.
$data.find('[data-embed-code]').each(function() {
var $this = $(this);
$this.html($this.attr('data-embed-code'));
});

data[key].value = $data.html();
});

Expand Down Expand Up @@ -1063,10 +1069,25 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
success: function(data) {
var html = data && data.html;

if (data && !data.html && data.type === 'photo' && data.url) {
if (data && !html && data.type === 'photo' && data.url) {
html = '<img src="' + data.url + '" alt="">';
}

if (!html) {
// Prevent render empty embed.
$.proxy(that, 'convertBadEmbed', url)();
return;
}

if (html && html.indexOf('</script>') > -1) {
// Store embed code with <script> tag inside wrapper attribute value.
// Make nice attribute value escaping using jQuery.
var $div = $('<div>')
.attr('data-embed-code', html)
.html(html);
html = $('<div>').append($div).html();
}

$.proxy(that, 'embed', html)();
},
error: function(jqXHR, textStatus, errorThrown) {
Expand Down
6 changes: 3 additions & 3 deletions dist/js/medium-editor-insert-plugin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medium-editor-insert-plugin",
"version": "2.2.1",
"version": "2.2.2",
"description": "jQuery insert plugin for MediumEditor",
"license": "MIT",
"homepage": "https://github.com/orthes/medium-editor-insert-plugin",
Expand Down

0 comments on commit d02646e

Please sign in to comment.