diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index db622ca..a413597 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -183,11 +183,19 @@ var plugin = { return function(_, text){ elem.style ??= [] elem.style.push(...style) - return typeof(code) == 'function' ? - code(...arguments) - : code != null ? - code - : text } }, + // handler... + if(typeof(code) == 'function'){ + return code(...arguments) } + // explicit code... + if(code != null){ + return code } + // get first non-empty group... + var groups = [...arguments].slice(1, -2) + while(groups.length > 0 + && groups[0] == null){ + groups.shift() } + return groups[0] + ?? '' } }, } @@ -434,6 +442,7 @@ var tasks = { status: [ 'DONE', 'REJECT', + //'TODO', ], // format: // [ diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index cce1637..a234cb6 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -50,11 +50,6 @@ var setup = function(){ - - ## Bugs: focused:: true - - BUG: \DONE at end of block replaces block with ~undefined~ - - example: - - this is some text DONE - - should look like: - - DONE this is dome text - BUG: `toc` does not track auto headings... - BUG: styling error... - this _seems `to` work_