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 {
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;

View File

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

View File

@ -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+/ -&gt; &lt;tr&gt;&lt;td&gt;
- ## 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_~
- ~<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~
- ~add optional text styling to nodes~
-
@ -125,7 +121,7 @@ var setup = function(){
- y
- z
- c
- &gt; 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 <b>code</b>`
- Marking ==text==
- Line
- ---