diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index 700f5c8..3d3b39c 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -450,12 +450,17 @@ editor .outline .block:focus { /* code... */ +.editor .outline .block>.view pre, .editor .outline .block>.view code { padding: 0.1em 0.3em; font-family: monospace; background: rgba(0,0,0,0.07); border-radius: 0.2em; } +.editor .outline .block>.view pre { + padding: 1em 1em; + padding-bottom: 1.5em; +} /* Tables... */ diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 02644c7..8dc2a94 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -327,18 +327,22 @@ var Outline = { elem.style.push(...style) return code ?? text } } - var quote = function(_, code){ - code = code + var quoteText = function(text){ + return text .replace(/(?/g, '>') - .replace(/\\(?!`)/g, '\\\\') - return `${code}` } + .replace(/\\(?!`)/g, '\\\\') } + var quote = function(_, code){ + return `${quoteText(code)}` } + var pre = function(_, code){ + return `
${ quoteText(code) }
` } var table = function(_, body){ - body = body - .replace(/\s*\|\s*\n\s*\|\s*/gm, '\n') - .replace(/\s*\|\s*/gm, '') - return `
${body}
` } + return `\n
${ + body + .replace(/\s*\|\s*\n\s*\|\s*/gm, '
') + .replace(/\s*\|\s*/gm, '') + }
` } elem.text = code // hidden attributes... // XXX make this generic... @@ -394,6 +398,8 @@ var Outline = { .replace(/(?$1') .replace(/(?$1') .replace(/(?$1') + // code/quoting... + .replace(/(?$1') diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 7bbdb8b..d43bd9d 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -36,6 +36,7 @@ var setup = function(){ - Bonsai - - ## Bugs: + - BUG: ASAP: editor: `-` at start of line is interpreted as block marker... - 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... @@ -43,7 +44,6 @@ var setup = function(){ - 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... @@ -131,36 +131,39 @@ var setup = function(){ - ; ASM-style comment - XXX Highlight - Basic inline *bold*, _italic_ and ~striked~ - - Code - - Quoting `html code` - Marking ==text== + - Code + - Inline quoting `html code` + - code blocks + ``` + var text = 'Hello, world!' + + console.log(text) + ``` + _syntax higlighting not yet supported..._ - Line - --- - Markers: ASAP, BUG, FIX, HACK, STUB, WARNING, and CAUTION - - Inline [X] checkboxes [_] - - To do items/blocks - - [_] undone item - _(clicking the checkbox updates the item)_ - - [X] done item - - [_] we can also add inline [x] checkboxes - - link + - Basic task management + - Inline [X] checkboxes [_] + - To do items/blocks + - [_] undone item + _(clicking the checkbox updates the item)_ + - [X] done item + - [_] we can also add inline [x] checkboxes + - links - [example](about:blank) - https://example.com - - ./path/to/file /path/to -- not supported yet + - ./path/to/file /path/to -- _not supported yet_ - Tables - | a | b | c | | 1 | 2 | 3 | | 11 | 22 | 33 | - - Symbols -- should these be ligatures? + - Symbols -- _should these be ligatures?_ - (i), (c), /!\, ... - -- and --- - - markdown: - - numbered lists - - ~tables~ - - code blocks - - ~alerts~ - - footnotes?? - - + - + - --- - ### Playground for testing - A collapsed:: true