Compare commits

...

5 Commits

Author SHA1 Message Date
2ddcf93faf notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-10-20 19:35:52 +03:00
09c14f3404 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-10-20 19:26:20 +03:00
bf31acf2b5 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-10-20 19:07:57 +03:00
ab9d2ead09 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-10-20 19:01:55 +03:00
df7b74f1a3 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-10-20 19:00:35 +03:00
2 changed files with 47 additions and 7 deletions

View File

@ -538,16 +538,52 @@ var styling = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// XXX use ligatures for these???
var symbols = {
__proto__: plugin,
// XXX use a single regex with handler func to do these...
symbols: {
'>>': '»',
'<<': '«',
'->': '→',
'<-': '←',
'=>': '⇒',
'<=': '⇐',
'(i)': '🛈',
'(c)': '©',
'/!\\': '⚠',
},
get symbols_pattern(){
return (this.symbols != null
&& Object.keys(this.symbols).length > 0) ?
new RegExp(`(?<!\\\\)(${
Object.keys(this.symbols)
.join('|')
.replace(/([\(\)\\\/])/g, '\\$1') })`, 'g')
: undefined },
__parse__: function(text, editor, elem){
var that = this
var p = this.symbols_pattern
text = p ?
text.replace(p,
function(m){
return that.symbols[m] })
: text
return text
// characters...
/* XXX
.replace(/(?<!\\)>>/gm, '»')
.replace(/(?<!\\)<</gm, '«')
.replace(/(?<![\\<])->/gm, '→')
.replace(/(?<![\\<])=>/gm, '⇒')
.replace(/(?<!\\)<-(?!>)/gm, '←')
.replace(/(?<!\\)<=(?!>)/gm, '⇐')
.replace(/(?<!\\)\(i\)/gm, '🛈')
.replace(/(?<!\\)\(c\)/gm, '©')
.replace(/(?<!\\)\/!\\/gm, '⚠')
//*/
.replace(/(?<!\\)---(?!-)/gm, '&mdash;')
.replace(/(?<!\\)--(?!-)/gm, '&ndash;') },
}

View File

@ -51,13 +51,14 @@ var setup = function(){
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
- ASAP: call `.sync()` on all changes...
- pgup/pgdown/home/end buttons
- autofocus (option)
- copy/paste nodes/trees
- identify a block (index, id, ...)
- focus
- `<editor>.autofocus`
- `focused:: true` attr (`.text(..)`/`.json(..)`/`.load(..)`)
- focusing editor -> focus focused block
- undo
collapsed:: true
- delete node
- indent/deindent
- edit node
- edit stack (position, action, ...)
- auto-shift done blocks to the end of siblings... (option?)
- ...or should this be `sort:: done` -- i.e. sort children by done status??
- codeblock as a block
@ -68,6 +69,7 @@ var setup = function(){
code
```
- _bullet should be either in the middle of the block or at the first line of code (preferred)..._
- copy/paste nodes/trees
- FEATURE: read-only mode
- export html
- embed css
@ -87,6 +89,7 @@ var setup = function(){
- `<editable/>` -- field marker
- each child node will copy the template and allow editing of only fields
- not clear how to handle template changes...
- cli
- Q: do we use \\t for indent? (option???)
- Q: persistent empty first/last node (a button to create a new node)?
- Q: should list bullets be on the same level as nodes or offset??
@ -261,7 +264,8 @@ var setup = function(){
| 11 | 22 | 33 |
- Symbols -- _should these be ligatures?_
- (i), (c), /!\, ...
- -- and ---
- <-, ->, <=, =>, <<, >> _(not sure about these)_
- -- and ---
-
- ---
- ### Playground for testing