clenup and notes....

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-14 15:46:42 +03:00
parent ea00679b9f
commit ec04205bfa
3 changed files with 38 additions and 24 deletions

View File

@ -408,6 +408,14 @@ editor .outline .block:focus {
} }
/*---------------------------------------------------------- Done ---*/
.editor .outline .block.DONE>.view {
text-decoration: line-through;
opacity: 0.5;
}
/*--------------------------------------------------- Highlightes ---*/ /*--------------------------------------------------- Highlightes ---*/
.editor .outline .highlight { .editor .outline .highlight {

View File

@ -26,8 +26,17 @@ var atLine = function(elem, index){
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Plugins...
// general helpers and utils...
var plugin = { var plugin = {
encode: function(text){
return text
.replace(/(?<!\\)&/g, '&amp;')
.replace(/(?<!\\)</g, '&lt;')
.replace(/(?<!\\)>/g, '&gt;')
.replace(/\\(?!`)/g, '\\\\') },
// XXX make this more generic... // XXX make this more generic...
style: function(editor, elem, style, code=undefined){ style: function(editor, elem, style, code=undefined){
style = [style].flat() style = [style].flat()
@ -43,7 +52,6 @@ var plugin = {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var attributes = { var attributes = {
@ -89,6 +97,8 @@ var blocks = {
.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'))
.replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/m, this.style(editor, elem, 'NOTE')) .replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/m, this.style(editor, elem, 'NOTE'))
.replace(/^\s*(?<!\\)DONE\s+(.*)$/m, this.style(editor, elem, 'DONE'))
.replace(/^(.*)\s*(?<!\\)DONE\s*$/m, this.style(editor, elem, 'DONE'))
.replace(/^\s*(?<!\\)XXX\s+(.*)$/m, this.style(editor, elem, 'XXX')) .replace(/^\s*(?<!\\)XXX\s+(.*)$/m, this.style(editor, elem, 'XXX'))
.replace(/^(.*)\s*(?<!\\)XXX$/m, this.style(editor, elem, 'XXX')) } , .replace(/^(.*)\s*(?<!\\)XXX$/m, this.style(editor, elem, 'XXX')) } ,
} }
@ -100,13 +110,6 @@ var blocks = {
var quoted = { var quoted = {
__proto__: plugin, __proto__: plugin,
encode: function(text){
return text
.replace(/(?<!\\)&/g, '&amp;')
.replace(/(?<!\\)</g, '&lt;')
.replace(/(?<!\\)>/g, '&gt;')
.replace(/\\(?!`)/g, '\\\\') },
// can be used in: // can be used in:
// <string>.replace(quoted.pattern, quoted.handler) // <string>.replace(quoted.pattern, quoted.handler)
quote_pattern: /(?<!\\)`(?=[^\s])(([^`]|\\`)*[^\s])(?<!\\)`/gm, quote_pattern: /(?<!\\)`(?=[^\s])(([^`]|\\`)*[^\s])(?<!\\)`/gm,

View File

@ -41,6 +41,8 @@ var setup = function(){
- Tomboy - Tomboy
- Bonsai - Bonsai
- -
- // Seems that I unintentionally implemented quite a chunk of the markdown spec ;)
-
- ## Bugs: - ## Bugs:
- BUG: ASAP: editor: `-` at start of line is interpreted as block marker... - BUG: ASAP: editor: `-` at start of line is interpreted as block marker...
- need to either: - need to either:
@ -102,21 +104,21 @@ var setup = function(){
block text block text
- NOTE: this is only a problem if making list-items manually -- disable??? - NOTE: this is only a problem if making list-items manually -- disable???
- empty item height is a bit off... - empty item height is a bit off...
- ~Q: can we edit code in a code block directly? (a-la Logseq)~ - DONE Q: can we edit code in a code block directly? (a-la Logseq)
- ~"percentage complete" in parent blocks with todo's nested~ - DONE "percentage complete" in parent blocks with todo's nested
- ~`.editor .outline:empty` view and behavior...~ - DONE `.editor .outline:empty` view and behavior...
- ~editor: semi-live update styles~ - DONE editor: semi-live update styles
- ~do a better expand/collapse icons~ - DONE do a better expand/collapse icons
- ~loading from DOM -- fill textarea~ - DONE loading from DOM -- fill textarea
- ~focus management~ - DONE focus management
- ~mouse/touch controls~ - DONE mouse/touch controls
- ~navigation~ - DONE navigation
- ~expand/collapse subtree~ - DONE expand/collapse subtree
- ~shift subtree up/down~ - DONE shift subtree up/down
- ~create node~ - DONE create node
- ~edit node~ - DONE edit node
- ~serialize/deserialize~ - DONE serialize/deserialize
- ~add optional text styling to nodes~ - DONE add optional text styling to nodes
- -
- ## Refactoring: - ## Refactoring:
- Plugin architecture - Plugin architecture
@ -185,9 +187,10 @@ var setup = function(){
- // C-style comment - // C-style comment
- ; ASM-style comment - ; ASM-style comment
- XXX Highlight - XXX Highlight
- DONE Done
- Basic inline *bold*, _italic_ and ~striked~ - Basic inline *bold*, _italic_ and ~striked~
- Marking ==text== - Marking ==text==
- Code - Code:
- Inline quoting `html <b>code</b>` - Inline quoting `html <b>code</b>`
- code blocks - code blocks
```javascript ```javascript