From 977b04afb938674897a20323ceca99638831b63a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 7 Nov 2023 00:12:35 +0300 Subject: [PATCH 1/2] found yet another new tiny little inconsistency... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 1 + experiments/outline-editor/index.html | 1 + 2 files changed, 2 insertions(+) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index f04f35f..3607dc4 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -158,6 +158,7 @@ var getMarkdownOffset = function(markdown, text, i){ // chars in text can lead to false positives and lots of potential // (not implemented) backtracking... // ...needs thought... +// Q: can we cheat with this? =) var getMarkdownOffset = function(markdown, text, i){ i = i ?? text.length var map = [] diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index d0588fe..8bec530 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -68,6 +68,7 @@ var setup = function(){ this returns `69` while it should return `5` _...replacing `\n\n\n` with `\n\n` seems to fix the issue (also works with spaces)_ (BUG also the above line is not italic -- can't reproduce) + - clicking right of the last line places cursor wrong - DONE M M can't place cursor before first char M From 5f1242b7661607397d86f3bcfd773cb35c2a9756 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 7 Nov 2023 00:56:02 +0300 Subject: [PATCH 2/2] note... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 2 +- experiments/outline-editor/index.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 3607dc4..6e461fa 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -133,7 +133,7 @@ var getCharOffset = function(elem, x, y, data){ // markdown: '# Hea|ding' // // XXX we are not checking both lengths of markdown AND text... -/*/ XXX +// XXX var getMarkdownOffset = function(markdown, text, i){ i = i ?? text.length var m = 0 diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 8bec530..c386173 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -69,6 +69,7 @@ var setup = function(){ _...replacing `\n\n\n` with `\n\n` seems to fix the issue (also works with spaces)_ (BUG also the above line is not italic -- can't reproduce) - clicking right of the last line places cursor wrong + - _this is a problem with the new version of `getMarkdownOffset(..)`_ - DONE M M can't place cursor before first char M