mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-24 20:01:56 +00:00
Compare commits
5 Commits
436bf6ffae
...
2ddcf93faf
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ddcf93faf | |||
| 09c14f3404 | |||
| bf31acf2b5 | |||
| ab9d2ead09 | |||
| df7b74f1a3 |
@ -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, '—')
|
||||
.replace(/(?<!\\)--(?!-)/gm, '–') },
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user