fixes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-12 22:13:38 +03:00
parent dcc4ff1aee
commit 9494439f77
3 changed files with 23 additions and 17 deletions

View File

@ -376,9 +376,11 @@ editor .outline .block:focus {
.editor .outline .NOTE>.view:empty { .editor .outline .NOTE>.view:empty {
display: none; display: none;
} }
.editor .outline .NOTE>.view:empty ~ .block { .editor .outline .NOTE:focus>.view:empty {
/* XXX calculate this... */ display: block;
margin-left: 1em; }
.editor .outline .NOTE>.view:empty ~ .children {
margin-left: -1rem;
} }
.editor .outline .NOTE>.view:before { .editor .outline .NOTE>.view:before {
content: "" !important; content: "" !important;

View File

@ -327,12 +327,18 @@ var Outline = {
elem.style.push(...style) elem.style.push(...style)
return code return code
?? text } } ?? text } }
var quote = function(_, code){
code = code
.replace(/(?<!\\)&/g, '&amp;')
.replace(/(?<!\\)</g, '&lt;')
.replace(/(?<!\\)>/g, '&gt;')
.replace(/\\(?!`)/g, '\\\\')
return `<code>${code}</code>` }
var table = function(_, body){ var table = function(_, body){
return `<table><tr><td>${ body = body
body .replace(/\s*\|\s*\n\s*\|\s*/gm, '</td></tr>\n<tr><td>')
.replace(/\s*\|\s*\n\s*\|\s*/gm, '</td></tr>\n<tr><td>') .replace(/\s*\|\s*/gm, '</td><td>')
.replace(/\s*\|\s*/gm, '</td><td>') return `<table><tr><td>${body}</td></td></table>` }
}</td></td></table>` }
elem.text = code elem.text = code
// hidden attributes... // hidden attributes...
// XXX make this generic... // XXX make this generic...
@ -388,7 +394,7 @@ var Outline = {
.replace(/(?<!\\)\*(?=[^\s*])(([^*]|\\\*)*[^\s*])(?<!\\)\*/gm, '<b>$1</b>') .replace(/(?<!\\)\*(?=[^\s*])(([^*]|\\\*)*[^\s*])(?<!\\)\*/gm, '<b>$1</b>')
.replace(/(?<!\\)~(?=[^\s~])(([^~]|\\~)*[^\s~])(?<!\\)~/gm, '<s>$1</s>') .replace(/(?<!\\)~(?=[^\s~])(([^~]|\\~)*[^\s~])(?<!\\)~/gm, '<s>$1</s>')
.replace(/(?<!\\)_(?=[^\s_])(([^_]|\\_)*[^\s_])(?<!\\)_/gm, '<i>$1</i>') .replace(/(?<!\\)_(?=[^\s_])(([^_]|\\_)*[^\s_])(?<!\\)_/gm, '<i>$1</i>')
.replace(/(?<!\\)`(?=[^\s])(([^`]|\\`)*[^\s])(?<!\\)`/gm, '<code>$1</code>') .replace(/(?<!\\)`(?=[^\s])(([^`]|\\`)*[^\s])(?<!\\)`/gm, quote)
// XXX support "\==" in mark... // XXX support "\==" in mark...
.replace(/(?<!\\)==(?=[^\s])(.*[^\s])(?<!\\)==/gm, '<mark>$1</mark>') .replace(/(?<!\\)==(?=[^\s])(.*[^\s])(?<!\\)==/gm, '<mark>$1</mark>')
// links... // links...

View File

@ -35,17 +35,17 @@ var setup = function(){
- Tomboy - Tomboy
- Bonsai - Bonsai
- -
- ## ToDo: - ## Bugs:
- BUG? pressing down from a longer line will jump over a shorter line - BUG? pressing down from a longer line will jump over a shorter line
- here is the line to jump from, for example from here - here is the line to jump from, for example from here
an we'll not get here... an we'll not get here...
- ASAP: fix quotes - ## ToDo:
- Example: /\n\s*\|\s+/ -&gt; &lt;tr&gt;&lt;td&gt;
- ASAP: editor: bksapce/del at start/end of a block should join it with prev/next - 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: pressing enter in text edit mode should split text into two blocks
- ASAP: editor: shifting nodes up/down - ASAP: editor: shifting nodes up/down
- ASAP: editor: `-` at start of line is interpreted as block marker... - ASAP: editor: `-` at start of line is interpreted as block marker...
- ASAP: use \\t for indent... - 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... - on item click, place the cursor where it was clicked before the code expanded...
- ~editor: semi-live update styles~ - ~editor: semi-live update styles~
- need to reach checkboxes via keyboard - need to reach checkboxes via keyboard
@ -80,10 +80,6 @@ var setup = function(){
- indent/deindent - indent/deindent
- edit node - edit node
- empty item height is a bit off... - empty item height is a bit off...
- ~handle links gracefully -- open/edit
_just click in the empty space_~
- ~<a href="about:blank">this takes the whole element</a>~
- this breaks if link is exactly line width -- should we ensure empty space?
- ~serialize/deserialize~ - ~serialize/deserialize~
- ~add optional text styling to nodes~ - ~add optional text styling to nodes~
- -
@ -125,7 +121,7 @@ var setup = function(){
- y - y
- z - z
- c - c
- &gt; quoted text - > quote
- Notes - Notes
- NOTE: a note text - NOTE: a note text
- NOTE: - NOTE:
@ -135,6 +131,8 @@ var setup = function(){
- ; ASM-style comment - ; ASM-style comment
- XXX Highlight - XXX Highlight
- Basic inline *bold*, _italic_ and ~striked~ - Basic inline *bold*, _italic_ and ~striked~
- Code
- Quoting `html <b>code</b>`
- Marking ==text== - Marking ==text==
- Line - Line
- --- - ---