Skip to content

Commit

Permalink
fix(DOM): corrected bug #1343 where we were incorrectly setting the <…
Browse files Browse the repository at this point in the history
…a> link on a <li> element
  • Loading branch information
JoelParke committed Sep 29, 2016
1 parent 6097ce3 commit 44d5c56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
if (/<br>/i.test(__h)) {
// Firefox adds <br>'s and so we remove the <br>
__h = __h.replace(/<br>/i, '&#8203;'); // no space-space
selectedElement.innerHTML = __h;
taSelection.setSelectionToElementEnd(selectedElement.childNodes[0]);
selectedElement = taSelection.getSelectionElement();
}
selectedElement.innerHTML = __h;
} else if (selectedElement.tagName.toLowerCase() === 'li' &&
ourSelection && ourSelection.start &&
ourSelection.start.offset === ourSelection.end.offset) {
Expand All @@ -156,8 +158,10 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
if (/<br>/i.test(__h)) {
// Firefox adds <br>'s and so we remove the <br>
__h = __h.replace(/<br>/i, ''); // nothing
selectedElement.innerHTML = __h;
taSelection.setSelectionToElementEnd(selectedElement.childNodes[0]);
selectedElement = taSelection.getSelectionElement();
}
selectedElement.innerHTML = __h;
}
}
}catch(e){}
Expand Down

0 comments on commit 44d5c56

Please sign in to comment.