mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ab9d2ead09
commit
bf31acf2b5
@ -556,20 +556,24 @@ var symbols = {
|
|||||||
'/!\\': '⚠',
|
'/!\\': '⚠',
|
||||||
},
|
},
|
||||||
get symbols_pattern(){
|
get symbols_pattern(){
|
||||||
return new RegExp(`(?<!\\\\)(${
|
return (this.symbols != null
|
||||||
Object.keys(this.symbols)
|
&& Object.keys(this.symbols).length > 0) ?
|
||||||
.join('|')
|
new RegExp(`(?<!\\\\)(${
|
||||||
.replace(/([\(\)\\\/])/g, '\\$1')
|
Object.keys(this.symbols)
|
||||||
})`, 'g') },
|
.join('|')
|
||||||
|
.replace(/([\(\)\\\/])/g, '\\$1') })`, 'g')
|
||||||
|
: undefined },
|
||||||
|
|
||||||
__parse__: function(text, editor, elem){
|
__parse__: function(text, editor, elem){
|
||||||
var that = this
|
var that = this
|
||||||
return text
|
var p = this.symbols_pattern
|
||||||
//* XXX
|
text = p ?
|
||||||
.replace(this.symbols_pattern,
|
text.replace(p,
|
||||||
function(m){
|
function(m){
|
||||||
return that.symbols[m] })
|
return that.symbols[m] })
|
||||||
/*/
|
: text
|
||||||
|
return text
|
||||||
|
/* XXX
|
||||||
.replace(/(?<!\\)>>/gm, '»')
|
.replace(/(?<!\\)>>/gm, '»')
|
||||||
.replace(/(?<!\\)<</gm, '«')
|
.replace(/(?<!\\)<</gm, '«')
|
||||||
.replace(/(?<![\\<])->/gm, '→')
|
.replace(/(?<![\\<])->/gm, '→')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user