Skip to content

Commit

Permalink
5.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Oct 8, 2015
1 parent 82c57a2 commit 961d508
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
5.8.3 / 2015-10-08
==================
* Fix changing link on images


5.8.2 / 2015-09-21
==================
* Fix type of elements which can contain auto-links
Expand Down
10 changes: 9 additions & 1 deletion dist/js/medium-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6332,6 +6332,14 @@ MediumEditor.extensions = {};
editableElementIndex: exportedSelection.editableElementIndex
}
);
// If textNodes are not present, when changing link on images
// ex: <a><img src="http://image.test.com"></a>, change fragment to currRange.startContainer
// and set textNodes array to [imageElement, imageElement]
if (textNodes.length === 0) {
fragment = this.options.ownerDocument.createDocumentFragment();
fragment.appendChild(commonAncestorContainer.cloneNode(true));
textNodes = [fragment.firstChild.firstChild, fragment.firstChild.lastChild];
}

// Creates the link in the document fragment
MediumEditor.util.createLink(this.options.ownerDocument, textNodes, opts.url.trim());
Expand Down Expand Up @@ -6430,7 +6438,7 @@ MediumEditor.parseVersionString = function (release) {

MediumEditor.version = MediumEditor.parseVersionString.call(this, ({
// grunt-bump looks for this:
'version': '5.8.2'
'version': '5.8.3'
}).version);

return MediumEditor;
Expand Down
2 changes: 1 addition & 1 deletion dist/js/medium-editor.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",
"version": "5.8.2",
"version": "5.8.3",
"author": "Davi Ferreira <hi@daviferreira.com>",
"contributors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/js/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ MediumEditor.parseVersionString = function (release) {

MediumEditor.version = MediumEditor.parseVersionString.call(this, ({
// grunt-bump looks for this:
'version': '5.8.2'
'version': '5.8.3'
}).version);

0 comments on commit 961d508

Please sign in to comment.