Compare commits

..

No commits in common. "2ddcf93faf7be37c5a5bca82b53360f7ac0cd6bd" and "436bf6ffae6b6068e58f321375d7a3601de2e999" have entirely different histories.

2 changed files with 7 additions and 47 deletions

View File

@ -538,52 +538,16 @@ 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
/* XXX
.replace(/(?<!\\)>>/gm, '»')
.replace(/(?<!\\)<</gm, '«')
.replace(/(?<![\\<])->/gm, '→')
.replace(/(?<![\\<])=>/gm, '⇒')
.replace(/(?<!\\)<-(?!>)/gm, '←')
.replace(/(?<!\\)<=(?!>)/gm, '⇐')
// characters...
.replace(/(?<!\\)\(i\)/gm, '🛈')
.replace(/(?<!\\)\(c\)/gm, '©')
.replace(/(?<!\\)\/!\\/gm, '⚠')
//*/
.replace(/(?<!\\)---(?!-)/gm, '&mdash;')
.replace(/(?<!\\)--(?!-)/gm, '&ndash;') },
}

View File

@ -51,14 +51,13 @@ 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
- identify a block (index, id, ...)
- focus
- `<editor>.autofocus`
- `focused:: true` attr (`.text(..)`/`.json(..)`/`.load(..)`)
- focusing editor -> focus focused block
- autofocus (option)
- copy/paste nodes/trees
- undo
collapsed:: true
- edit stack (position, action, ...)
- delete node
- indent/deindent
- edit node
- 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
@ -69,7 +68,6 @@ 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
@ -89,7 +87,6 @@ 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??
@ -264,8 +261,7 @@ var setup = function(){
| 11 | 22 | 33 |
- Symbols -- _should these be ligatures?_
- (i), (c), /!\, ...
- <-, ->, <=, =>, <<, >> _(not sure about these)_
- -- and ---
- -- and ---
-
- ---
- ### Playground for testing