fixes and notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-11-13 13:52:31 +03:00
parent 747b459989
commit 7b0cac82bf
2 changed files with 39 additions and 15 deletions

View File

@ -264,8 +264,8 @@ var blocks = {
.replace(/^(?<!\\)#\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-1'])) .replace(/^(?<!\\)#\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-1']))
// style: list... // style: list...
//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item')) //.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
.replace(/^\s*(.*)(?<!\\):\s*$/m, this.style(editor, elem, 'list')) .replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list'))
.replace(/^\s*(.*)(?<!\\)#\s*$/m, this.style(editor, elem, 'numbered-list')) .replace(/^\s*(.*)(?<!\\)#\s*$/, this.style(editor, elem, 'numbered-list'))
// style: misc... // style: misc...
.replace(/^\s*(?<!\\)>\s+(.*)$/m, this.style(editor, elem, 'quote')) .replace(/^\s*(?<!\\)>\s+(.*)$/m, this.style(editor, elem, 'quote'))
.replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/m, this.style(editor, elem, 'comment')) .replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/m, this.style(editor, elem, 'comment'))
@ -289,6 +289,9 @@ var quoted = {
return `<code>${ this.encode(code) }</code>` }, return `<code>${ this.encode(code) }</code>` },
pre_pattern: /(?<!\\)```(.*\s*\n)((\n|.)*?)\h*(?<!\\)```(?:[ \t]*$|[ \t]*\n)/g, pre_pattern: /(?<!\\)```(.*\s*\n)((\n|.)*?)\h*(?<!\\)```(?:[ \t]*$|[ \t]*\n)/g,
preEncode: function(text){
return this.encode(text)
.replace(/`/, '\\`') },
pre: function(_, language, code){ pre: function(_, language, code){
language = language.trim() language = language.trim()
language = language ? language = language ?
@ -296,7 +299,7 @@ var quoted = {
: language : language
return `<pre>` return `<pre>`
+`<code contenteditable="true" class="${language}">${ +`<code contenteditable="true" class="${language}">${
this.encode(code) this.preEncode(code)
}</code>` }</code>`
+`</pre>` }, +`</pre>` },
@ -727,7 +730,7 @@ var styling = {
// markers... // markers...
.replace(/(\s*)(?<!\\)(FEATURE[:?]|Q:|Question:|Note:)(\s*)/gm, .replace(/(\s*)(?<!\\)(FEATURE[:?]|Q:|Question:|Note:)(\s*)/gm,
'$1<b class="$2">$2</b>$3') '$1<b class="$2">$2</b>$3')
.replace(/(\s*)(?<!\\)(ASAP|BUG|FIX|HACK|STUB|WARNING|CAUTION)(\s*)/gm, .replace(/(\s*)(?<!\\)(ASAP|TEST|BUG|FIX|HACK|STUB|WARNING|CAUTION)(\s*)/gm,
'$1<span class="highlight $2">$2</span>$3') '$1<span class="highlight $2">$2</span>$3')
// elements... // elements...
.replace(/(\n|^)(?<!\\)---*\h*(\n|$)/m, '$1<hr>') .replace(/(\n|^)(?<!\\)---*\h*(\n|$)/m, '$1<hr>')

View File

@ -48,6 +48,24 @@ var setup = function(){
- -
- ## Bugs: - ## Bugs:
focused:: true focused:: true
- BUG: styling error...
- this _seems `to` work_
- `while` _this `does` not_
- _seems to be connected with quoting..._
- BUG blank line at end of block is initially not shown
- this block contains two lines (empty below)
-
this block also contains two lines (empty above)
-
this block contains three lines (empty above and below)
- BUG blank line at start of block is shown but removed on edit
-
this block also contains two lines (empty above)
-
this block contains three lines (empty above and below)
- BUG: can't move down out of a code block - BUG: can't move down out of a code block
- edit this line, then move down - edit this line, then move down
- ``` - ```
@ -55,6 +73,7 @@ var setup = function(){
``` ```
- this node can't be reached. - this node can't be reached.
- _this appears to be due to how we are resizing the text..._ - _this appears to be due to how we are resizing the text..._
- BUG resizing seems to be broken -- edit triggers a bad resize
- BUG: caret positioning broken - BUG: caret positioning broken
- *TODO*:: - *TODO*::
- text text text - text text text
@ -102,14 +121,6 @@ var setup = function(){
- |text|text|text| - |text|text|text|
|text|text|text| |text|text|text|
|text|text|text| |text|text|text|
- BUG: parser: code blocks do not ignore single back-quotes...
- ```
x = `moo`
```
- _this also leads to double quoting of html..._
```
x = `<i>moo</i>`
```
- BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - BUG: mobile browsers behave quite chaotically ignoring parts of the styling...
- FF: - FF:
- zooming on edited field - zooming on edited field
@ -119,17 +130,27 @@ var setup = function(){
- side margins are a bit too large - side margins are a bit too large
- still need to account for toolbar to the right - still need to account for toolbar to the right
- left side does not need to be as wide - left side does not need to be as wide
- DONE TEST BUG: parser: code blocks do not ignore single back-quotes...
collapsed:: true
- ```
x = `moo`
```
- _this also leads to double quoting of html..._
```
x = `<i>moo</i>`
```
- -
- ## ToDo: - ## ToDo:
- Time to think about a standalone client -- at least to edit own notes as a test... - Time to think about a standalone client -- at least to edit own notes as a test...
- _also this would be a nice opportunity to start the move to a newer electron version_ - _also this would be a nice opportunity to start the move to a newer electron version_
- Q: Make the heading level depend on its depth?? - Q: Make the heading level depend on its depth??
- Might be a good idea to think how to avoid the constant selections on focus... - Might be a good idea to think how to avoid the constant selections on focus...
- Q: When moving up/down between nodes do we want to place the caret relative to markdown (current) or to view? (see: CARET_V_MOVE) - Q: When moving up/down between nodes do we want to place the caret relative to markdown (current) or to view? (see: `CARET_V_MOVE`)
- Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup??? - Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup???
- _...I'm leaning towards the later..._ - _...I'm leaning towards the later..._
- Q: Can we place a cursor in a table correctly??? - Q: Can we place a cursor in a table correctly???
- Q: Should tables be text-based markdown or higher-level? - Q: Should tables be text-based markdown or higher-level?
collapsed:: true
- for reference a normal table - for reference a normal table
- | col 1 | col 2 | col 3 | - | col 1 | col 2 | col 3 |
| moo | foo | boo | | moo | foo | boo |
@ -184,7 +205,7 @@ var setup = function(){
- CSS breaks if we do... - CSS breaks if we do...
- need to figure out a way to handle autofocus for host/editor uniformly - need to figure out a way to handle autofocus for host/editor uniformly
- -
- selection - node selection
- DONE multiple node selection (via shift+motion) - DONE multiple node selection (via shift+motion)
- fixed state -- while `shift` pressed select or deselect only depending on first action (a-la FAR) - fixed state -- while `shift` pressed select or deselect only depending on first action (a-la FAR)
- DONE double/triple click working... - DONE double/triple click working...
@ -485,7 +506,7 @@ var setup = function(){
``` ```
- Line - Line
- --- - ---
- Markers: ASAP, BUG, FIX, HACK, STUB, WARNING, and CAUTION - Markers: ASAP, TEST, BUG, FIX, HACK, STUB, WARNING, and CAUTION
- Basic task management - Basic task management
- [%] Completion status - [%] Completion status
- Inline [X] checkboxes [_] - Inline [X] checkboxes [_]