mirror of
https://github.com/flynx/pWiki.git
synced 2026-07-14 04:20:58 +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)
|
||||
|
||||
// set slot value...
|
||||
// XXX simplify this...
|
||||
/* XXX CONTENT...
|
||||
var stack = []
|
||||
slots[name]
|
||||
&& stack.push(slots[name])
|
||||
@ -1357,6 +1357,17 @@ module.parser = {
|
||||
.filter(function(e){
|
||||
return typeof(e) != 'function'
|
||||
|| 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 ?
|
||||
''
|
||||
: Object.assign(
|
||||
@ -1364,7 +1375,8 @@ module.parser = {
|
||||
return ((st ?? state).slots ?? {})[name]
|
||||
?? original },
|
||||
{slot: name}) }) }),
|
||||
'content': ['slot'],
|
||||
// XXX CONTENT...
|
||||
//'content': ['slot'],
|
||||
|
||||
|
||||
//
|
||||
|
||||
@ -54,6 +54,7 @@ test.Setups({
|
||||
...ins.map(function(e){
|
||||
return e + '<slot slot>third</slot>' }),
|
||||
'third' ] },
|
||||
/* XXX CONTENT...
|
||||
slot_content_empty: function(assert){
|
||||
return [
|
||||
'@slot(slot body="[[ <content/> ]]")',
|
||||
@ -71,7 +72,9 @@ test.Setups({
|
||||
...ins.map(function(i){
|
||||
return i +'@slot(slot value)' }),
|
||||
expect.replace('default', 'value') ] },
|
||||
//*/
|
||||
|
||||
// XXX these are an alternative to <content/>...
|
||||
slot_nested: function(assert){
|
||||
return [
|
||||
'<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)',
|
||||
'value' ] },
|
||||
|
||||
/* XXX CONTENT...
|
||||
// XXX the question with the next tow is:
|
||||
// should body override or nest?
|
||||
// ...both are logical but in either case the result should be
|
||||
@ -146,6 +150,7 @@ test.Setups({
|
||||
...ins.map(function(i){
|
||||
return i +'@slot(slot shown)' }),
|
||||
'' ] },
|
||||
//*/
|
||||
})
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user