diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index 4afeda0..700f5c8 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -376,9 +376,11 @@ editor .outline .block:focus { .editor .outline .NOTE>.view:empty { display: none; } -.editor .outline .NOTE>.view:empty ~ .block { - /* XXX calculate this... */ - margin-left: 1em; +.editor .outline .NOTE:focus>.view:empty { + display: block; +} +.editor .outline .NOTE>.view:empty ~ .children { + margin-left: -1rem; } .editor .outline .NOTE>.view:before { content: "" !important; diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 3db1c02..02644c7 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -327,12 +327,18 @@ var Outline = { elem.style.push(...style) return code ?? text } } + var quote = function(_, code){ + code = code + .replace(/(?/g, '>') + .replace(/\\(?!`)/g, '\\\\') + return `${code}` } var table = function(_, body){ - return `\n
${ - body - .replace(/\s*\|\s*\n\s*\|\s*/gm, '
') - .replace(/\s*\|\s*/gm, '') - }
` } + body = body + .replace(/\s*\|\s*\n\s*\|\s*/gm, '\n') + .replace(/\s*\|\s*/gm, '') + return `
${body}
` } elem.text = code // hidden attributes... // XXX make this generic... @@ -388,7 +394,7 @@ var Outline = { .replace(/(?$1') .replace(/(?$1') .replace(/(?$1') - .replace(/(?$1') + .replace(/(?$1') // links... diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index d777a3e..7bbdb8b 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -35,17 +35,17 @@ var setup = function(){ - Tomboy - Bonsai - -- ## ToDo: +- ## Bugs: - BUG? pressing down from a longer line will jump over a shorter line - here is the line to jump from, for example from here an we'll not get here... - - ASAP: fix quotes - - Example: /\n\s*\|\s+/ -> <tr><td> +- ## ToDo: - ASAP: editor: bksapce/del at start/end of a block should join it with prev/next - ASAP: editor: pressing enter in text edit mode should split text into two blocks - ASAP: editor: shifting nodes up/down - ASAP: editor: `-` at start of line is interpreted as block marker... - ASAP: use \\t for indent... + - ASAP: scroll into view is bad... - on item click, place the cursor where it was clicked before the code expanded... - ~editor: semi-live update styles~ - need to reach checkboxes via keyboard @@ -80,10 +80,6 @@ var setup = function(){ - indent/deindent - edit node - empty item height is a bit off... - - ~handle links gracefully -- open/edit - _just click in the empty space_~ - - ~this takes the whole element~ - - this breaks if link is exactly line width -- should we ensure empty space? - ~serialize/deserialize~ - ~add optional text styling to nodes~ - @@ -125,7 +121,7 @@ var setup = function(){ - y - z - c - - > quoted text + - > quote - Notes - NOTE: a note text - NOTE: @@ -135,6 +131,8 @@ var setup = function(){ - ; ASM-style comment - XXX Highlight - Basic inline *bold*, _italic_ and ~striked~ + - Code + - Quoting `html code` - Marking ==text== - Line - ---