diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 1b92989..2d63c68 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -133,17 +133,6 @@ var getMarkdownOffset = function(markdown, text, i){ m = p } } return m - t } -// NOTE: this is the same as .innerText but will not add extra "\n" after -// each block element... -var getTexts = function(elem, res=[]){ - for(var n of elem.childNodes){ - n.nodeType == n.TEXT_NODE ? - res.push(n.textContent) - : getTexts(n, res) } - return res } -var getText = function(elem){ - return getTexts(elem).join('') } - var offsetAt = function(A, B, i){ i ??= A.length-1 var o = 0 @@ -157,39 +146,17 @@ var offsetAt = function(A, B, i){ p = o } return o } -// -// offsetMap( -// 'abMcdefg', -// 'abcdeXfg') -// -> [0, 0, , -1, -1, -1, 0, 0] -// -// XXX this is still wrong -- the problem is that in more complex cases -// this finds a non-optimal solution... -// m = `text text text -//