mirror of
https://github.com/flynx/pWiki.git
synced 2026-07-19 23:07:20 +00:00
removed slot's <content/>...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b9b11ecbda
commit
8b5f156816
@ -1321,7 +1321,7 @@ module.parser = {
|
|||||||
: name in slots)
|
: name in slots)
|
||||||
|
|
||||||
// set slot value...
|
// set slot value...
|
||||||
// XXX simplify this...
|
/* XXX CONTENT...
|
||||||
var stack = []
|
var stack = []
|
||||||
slots[name]
|
slots[name]
|
||||||
&& stack.push(slots[name])
|
&& stack.push(slots[name])
|
||||||
@ -1357,6 +1357,17 @@ module.parser = {
|
|||||||
.filter(function(e){
|
.filter(function(e){
|
||||||
return typeof(e) != 'function'
|
return typeof(e) != 'function'
|
||||||
|| e.slot != name }) ) }
|
|| e.slot != name }) ) }
|
||||||
|
/*/
|
||||||
|
text = text ?
|
||||||
|
parser.expand(this, text ?? [], state)
|
||||||
|
: text
|
||||||
|
if(body && text){
|
||||||
|
var slot = text
|
||||||
|
} else {
|
||||||
|
var slot = body ?? text }
|
||||||
|
var original = slot
|
||||||
|
slots[name] = slot
|
||||||
|
//*/
|
||||||
return hidden ?
|
return hidden ?
|
||||||
''
|
''
|
||||||
: Object.assign(
|
: Object.assign(
|
||||||
@ -1364,7 +1375,8 @@ module.parser = {
|
|||||||
return ((st ?? state).slots ?? {})[name]
|
return ((st ?? state).slots ?? {})[name]
|
||||||
?? original },
|
?? original },
|
||||||
{slot: name}) }) }),
|
{slot: name}) }) }),
|
||||||
'content': ['slot'],
|
// XXX CONTENT...
|
||||||
|
//'content': ['slot'],
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@ -54,6 +54,7 @@ test.Setups({
|
|||||||
...ins.map(function(e){
|
...ins.map(function(e){
|
||||||
return e + '<slot slot>third</slot>' }),
|
return e + '<slot slot>third</slot>' }),
|
||||||
'third' ] },
|
'third' ] },
|
||||||
|
/* XXX CONTENT...
|
||||||
slot_content_empty: function(assert){
|
slot_content_empty: function(assert){
|
||||||
return [
|
return [
|
||||||
'@slot(slot body="[[ <content/> ]]")',
|
'@slot(slot body="[[ <content/> ]]")',
|
||||||
@ -71,7 +72,9 @@ test.Setups({
|
|||||||
...ins.map(function(i){
|
...ins.map(function(i){
|
||||||
return i +'@slot(slot value)' }),
|
return i +'@slot(slot value)' }),
|
||||||
expect.replace('default', 'value') ] },
|
expect.replace('default', 'value') ] },
|
||||||
|
//*/
|
||||||
|
|
||||||
|
// XXX these are an alternative to <content/>...
|
||||||
slot_nested: function(assert){
|
slot_nested: function(assert){
|
||||||
return [
|
return [
|
||||||
'<slot slot>[[ <slot slot.content/> ]]</slot>@slot(slot.content value)',
|
'<slot slot>[[ <slot slot.content/> ]]</slot>@slot(slot.content value)',
|
||||||
@ -81,6 +84,7 @@ test.Setups({
|
|||||||
'<slot slot>[[ <slot slot.content/> ]]</slot>@slot(slot value)',
|
'<slot slot>[[ <slot slot.content/> ]]</slot>@slot(slot value)',
|
||||||
'value' ] },
|
'value' ] },
|
||||||
|
|
||||||
|
/* XXX CONTENT...
|
||||||
// XXX the question with the next tow is:
|
// XXX the question with the next tow is:
|
||||||
// should body override or nest?
|
// should body override or nest?
|
||||||
// ...both are logical but in either case the result should be
|
// ...both are logical but in either case the result should be
|
||||||
@ -146,6 +150,7 @@ test.Setups({
|
|||||||
...ins.map(function(i){
|
...ins.map(function(i){
|
||||||
return i +'@slot(slot shown)' }),
|
return i +'@slot(slot shown)' }),
|
||||||
'' ] },
|
'' ] },
|
||||||
|
//*/
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user