mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-19 17:41:38 +00:00
fixes and tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d8e36c8916
commit
9439c01a75
59
pwiki2.js
59
pwiki2.js
@ -494,24 +494,40 @@ object.Constructor('BasePage', {
|
|||||||
// PREFIX -- 'inline' or 'elem'
|
// PREFIX -- 'inline' or 'elem'
|
||||||
var MACRO_ARGS =
|
var MACRO_ARGS =
|
||||||
module.MACRO_ARGS =
|
module.MACRO_ARGS =
|
||||||
['(',
|
['(',[
|
||||||
// arg='val' | arg="val" | arg=val
|
// arg='val' | arg="val" | arg=val
|
||||||
'|\\s+(?<PREFIXArgName>[a-z]+)\\s*=\\s*(',[
|
'\\s+(?<PREFIXArgName>[a-z]+)\\s*=\\s*(?<PREFIXArgValue>'+([
|
||||||
"'(?<PREFIXSingleQuotedValue>[^']*)'",
|
// XXX for some readon we are not getting anythinng
|
||||||
'"(?<PREFIXDoubleQuotedValue>[^"]*)"',
|
// matching back from these...
|
||||||
'(?<PREFIXValue>[^\\s"\']*)',
|
// ...but they seem to match correctly within
|
||||||
].join('|'),')',
|
// the macro -- nestin issue???
|
||||||
// "arg" | 'arg'
|
"'(?<PREFIXSingleQuotedValue>[^']*)'",
|
||||||
// XXX quote escaping???
|
'"(?<PREFIXDoubleQuotedValue>[^"]*)"',
|
||||||
// XXX CHROME/NODE BUG: this does not work yet...
|
'(?<PREFIXValue>[^\\sSTOP\'"]+)',
|
||||||
//'\\s+(?<quote>[\'"])[^\\k<quote>]*\\k<quote>',
|
].join('|'))+')',
|
||||||
'\\s+"(?<PREFIXDoubleQuotedArg>[^"]*)"',
|
// "arg" | 'arg'
|
||||||
"|\\s+'(?<PREFIXSingleQuotedArg>[^']*)'",
|
// XXX quote escaping???
|
||||||
// arg
|
// XXX CHROME/NODE BUG: this does not work yet...
|
||||||
//'|\\s+[^\\s\\/>\'"]+',
|
//'\\s+(?<quote>[\'"])[^\\k<quote>]*\\k<quote>',
|
||||||
'|\\s+(?<PREFIXArg>[^\\sSTOP\'"]+)',
|
'\\s+"(?<PREFIXDoubleQuotedArg>[^"]*)"',
|
||||||
|
"\\s+'(?<PREFIXSingleQuotedArg>[^']*)'",
|
||||||
|
// arg
|
||||||
|
//'|\\s+[^\\s\\/>\'"]+',
|
||||||
|
'\\s+(?<PREFIXArg>[^\\sSTOP\'"]+)',
|
||||||
|
].join('|'),
|
||||||
')'].join('')
|
')'].join('')
|
||||||
|
|
||||||
|
var buildArgsPattern =
|
||||||
|
module.buildArgsPattern =
|
||||||
|
function(prefix, stop='', regexp='smig'){
|
||||||
|
var pattern = module.MACRO_ARGS
|
||||||
|
.replace(/PREFIX/g, prefix)
|
||||||
|
.replace(/STOP/g, stop)
|
||||||
|
return regexp ?
|
||||||
|
new RegExp(pattern, regexp)
|
||||||
|
: pattern }
|
||||||
|
|
||||||
|
|
||||||
// needs:
|
// needs:
|
||||||
// MACROS
|
// MACROS
|
||||||
// INLINE_ARGS -- MACRO_ARGS.replace(/STOP/, ')')
|
// INLINE_ARGS -- MACRO_ARGS.replace(/STOP/, ')')
|
||||||
@ -527,17 +543,6 @@ module.MACRO =
|
|||||||
'</\\s*(?<nameClose>MACROS)\\s*>',
|
'</\\s*(?<nameClose>MACROS)\\s*>',
|
||||||
].join('|')
|
].join('|')
|
||||||
|
|
||||||
|
|
||||||
var buildArgsPattern =
|
|
||||||
module.buildArgsPattern =
|
|
||||||
function(prefix, stop='', regexp='smig'){
|
|
||||||
var pattern = module.MACRO_ARGS
|
|
||||||
.replace(/PREFIX/g, prefix)
|
|
||||||
.replace(/STOP/g, stop)
|
|
||||||
return regexp ?
|
|
||||||
new RegExp(pattern, regexp)
|
|
||||||
: pattern }
|
|
||||||
|
|
||||||
var buildMacroPattern =
|
var buildMacroPattern =
|
||||||
module.buildMacroPattern =
|
module.buildMacroPattern =
|
||||||
function(macros=['macro'], regexp='smig'){
|
function(macros=['macro'], regexp='smig'){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user