mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-03 12:30:07 +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'
|
||||
var MACRO_ARGS =
|
||||
module.MACRO_ARGS =
|
||||
['(',
|
||||
// arg='val' | arg="val" | arg=val
|
||||
'|\\s+(?<PREFIXArgName>[a-z]+)\\s*=\\s*(',[
|
||||
"'(?<PREFIXSingleQuotedValue>[^']*)'",
|
||||
'"(?<PREFIXDoubleQuotedValue>[^"]*)"',
|
||||
'(?<PREFIXValue>[^\\s"\']*)',
|
||||
].join('|'),')',
|
||||
// "arg" | 'arg'
|
||||
// XXX quote escaping???
|
||||
// XXX CHROME/NODE BUG: this does not work yet...
|
||||
//'\\s+(?<quote>[\'"])[^\\k<quote>]*\\k<quote>',
|
||||
'\\s+"(?<PREFIXDoubleQuotedArg>[^"]*)"',
|
||||
"|\\s+'(?<PREFIXSingleQuotedArg>[^']*)'",
|
||||
// arg
|
||||
//'|\\s+[^\\s\\/>\'"]+',
|
||||
'|\\s+(?<PREFIXArg>[^\\sSTOP\'"]+)',
|
||||
['(',[
|
||||
// arg='val' | arg="val" | arg=val
|
||||
'\\s+(?<PREFIXArgName>[a-z]+)\\s*=\\s*(?<PREFIXArgValue>'+([
|
||||
// XXX for some readon we are not getting anythinng
|
||||
// matching back from these...
|
||||
// ...but they seem to match correctly within
|
||||
// the macro -- nestin issue???
|
||||
"'(?<PREFIXSingleQuotedValue>[^']*)'",
|
||||
'"(?<PREFIXDoubleQuotedValue>[^"]*)"',
|
||||
'(?<PREFIXValue>[^\\sSTOP\'"]+)',
|
||||
].join('|'))+')',
|
||||
// "arg" | 'arg'
|
||||
// XXX quote escaping???
|
||||
// XXX CHROME/NODE BUG: this does not work yet...
|
||||
//'\\s+(?<quote>[\'"])[^\\k<quote>]*\\k<quote>',
|
||||
'\\s+"(?<PREFIXDoubleQuotedArg>[^"]*)"',
|
||||
"\\s+'(?<PREFIXSingleQuotedArg>[^']*)'",
|
||||
// arg
|
||||
//'|\\s+[^\\s\\/>\'"]+',
|
||||
'\\s+(?<PREFIXArg>[^\\sSTOP\'"]+)',
|
||||
].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:
|
||||
// MACROS
|
||||
// INLINE_ARGS -- MACRO_ARGS.replace(/STOP/, ')')
|
||||
@ -527,17 +543,6 @@ module.MACRO =
|
||||
'</\\s*(?<nameClose>MACROS)\\s*>',
|
||||
].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 =
|
||||
module.buildMacroPattern =
|
||||
function(macros=['macro'], regexp='smig'){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user