Skip to content

Commit

Permalink
Addresses, but is not a complete fix for bevacqua#47. There is an iss…
Browse files Browse the repository at this point in the history
…ue with chunking selection that doesn't quite split things correctly because `window.getSelection()` is returning the range values from the unescaped text. Need to manage the difference somewhere.
  • Loading branch information
LoveAndCoding committed Jun 29, 2017
1 parent c7b9188 commit a635dde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/getSurface.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ function surface (textarea, editable, droparea) {
}

function readNode (el) {
return el.nodeType === 3 ? fixEOL(el.textContent || el.innerText || '') : '';
if(el.nodeType === 3) {
// Using browser escaping to clean up any special characters
var toText = doc.createElement('div');
toText.appendChild(el.cloneNode());
return toText.innerHTML || '';
}
return '';
}
}

Expand Down

0 comments on commit a635dde

Please sign in to comment.