From c5c0ac4611fdbc4f06ed175ecc9fdb35cf7a5067 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 27 Nov 2023 03:02:43 +0300 Subject: [PATCH] notes and cleanup... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 6 +++++- experiments/outline-editor/index.html | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index eec1634..42af45b 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -886,6 +886,7 @@ var JSONOutline = { __styles: undefined, // block render... + // XXX PRE_POST_NEWLINE can we avoid explicitly patching for empty lines after pre??? __code2html__: function(code, elem={}){ var that = this @@ -937,7 +938,10 @@ var JSONOutline = { // patch for showing trailing empty lines in dom... elem.text = (elem.text == '' - // XXX adding a exception here feels hacky... + // XXX PRE_POST_NEWLINE can we avoid this?? + // ...simply .replace(/\n$/, '\n ') does not solve + // this -- doubles the single trailing empty line after pre... + // ...this will require a test for all block elements eventually (???) || elem.text.trim().endsWith('')) ? elem.text // NOTE: adding a space here is done to prevent the browser diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 36228ae..86fd3b4 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -111,7 +111,10 @@ var setup = function(){ - - ## ToDo: - add loading spinner -- `.loading` class set on `.load(..)` and unset when done... + - DONE set/unset class + - add animation - clicking left of the block can select one of parent blocks -- bug or feature?? + - _can we extend the left click zone all the way to the left edge???_ - `.json(..)`, `.data(..)`, ... should be signature compatible with `.get(..)` (???) - _current state causes constant confusion..._ - Time to think about a standalone client -- at least to edit own notes as a test... @@ -121,7 +124,6 @@ var setup = function(){ - Q: When moving up/down between nodes do we want to place the caret relative to markdown (current) or to view? (see: `CARET_V_MOVE`) - Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup??? - _...I'm leaning towards the later..._ - - Q: Can we place a cursor in a table correctly??? - Q: Should tables be text-based markdown or higher-level? collapsed:: true - for reference a normal table @@ -185,9 +187,8 @@ var setup = function(){ - delete - copy/cut/past (???) - touch/mouse (???) - - Q: should we select text (mouse/touch) without first focusing?? - - _...logseq does not do this either_ - - now this is possible by dragging from a click zone... + - Q: should we select text through multiple nodes?? + - _...should this turn into node selection as soon as node boundary is crossed???_ - copy/paste nodes/trees - numbered lists: add counters to a depth of 6-7... - _or find a way to make them repeat..._ @@ -519,6 +520,18 @@ var setup = function(){ - - --- - ### Playground for testing + - Empty line tests:: + - + leading + - trailing + + - + both + + - ``` + block with trailing empty line + ``` + - A collapsed:: true - a