Skip to content

Commit

Permalink
5.22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroc8 committed Jan 1, 2017
1 parent 34f070f commit 627c0b6
Showing 1 changed file with 4 additions and 5 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 627c0b6

Please sign in to comment.