move quote formatting out of react component

This commit is contained in:
Bruno Windels
2019-09-04 12:40:03 +02:00
parent b72d1a78ec
commit b35a3531bb
5 changed files with 55 additions and 57 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ export function getCaretOffsetAndText(editor, sel) {
return {caret: offset, text};
}
export function getSelectionOffsetAndText(editor, selectionNode, selectionOffset) {
function getSelectionOffsetAndText(editor, selectionNode, selectionOffset) {
// sometimes selectionNode is an element, and then selectionOffset means
// the index of a child element ... - 1 🤷
if (selectionNode.nodeType === Node.ELEMENT_NODE && selectionOffset !== 0) {