Skip to content

Commit

Permalink
Apply #1271 to the non dist file
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Jan 19, 2017
1 parent 94b79ba commit 0dd11d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
9 changes: 4 additions & 5 deletions dist/js/medium-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,10 @@ MediumEditor.extensions = {};
splitEndNodeIfNeeded: function (currentNode, newNode, matchEndIndex, currentTextIndex) {
var textIndexOfEndOfFarthestNode,
endSplitPoint;
textIndexOfEndOfFarthestNode = currentTextIndex + (newNode || currentNode).nodeValue.length +
(newNode ? currentNode.nodeValue.length : 0) -
1;
endSplitPoint = (newNode || currentNode).nodeValue.length -
(textIndexOfEndOfFarthestNode + 1 - matchEndIndex);
textIndexOfEndOfFarthestNode = currentTextIndex + currentNode.nodeValue.length +
(newNode ? newNode.nodeValue.length : 0) - 1;
endSplitPoint = matchEndIndex - currentTextIndex -
(newNode ? currentNode.nodeValue.length : 0);
if (textIndexOfEndOfFarthestNode >= matchEndIndex &&
currentTextIndex !== textIndexOfEndOfFarthestNode &&
endSplitPoint !== 0) {
Expand Down

0 comments on commit 0dd11d1

Please sign in to comment.