more tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-03-29 19:37:05 +03:00
parent 069605345e
commit 6640ac1c19

24
wiki.js
View File

@ -171,7 +171,8 @@ var macro = {
var path = $(elem).attr('src') var path = $(elem).attr('src')
return context.get(path) return context.get(path)
.map(function(page){ return page.raw }) .map(function(page){
return page.raw })
.join('\n') }), .join('\n') }),
quote: Macro('Include quoted page source (without parsing)', quote: Macro('Include quoted page source (without parsing)',
@ -198,7 +199,9 @@ var macro = {
// XXX // XXX
text = $(elem).html() text = $(elem).html()
text = text == '' ? $(elem).attr('text') : text text = text == '' ?
$(elem).attr('text')
: text
text = this.parse(context, text, state, true) text = this.parse(context, text, state, true)
//text = parse(elem) //text = parse(elem)
@ -210,9 +213,7 @@ var macro = {
} else if(name in state.slots){ } else if(name in state.slots){
state.slots[name] = text state.slots[name] = text
return '' return '' } }),
}
}),
//*/ //*/
// convert @ macro to html-like + parse content... // convert @ macro to html-like + parse content...
slot: Macro('Define/fill slot', slot: Macro('Define/fill slot',
@ -293,7 +294,8 @@ var macro = {
parse(e, page) parse(e, page)
return e[0] })) } return e[0] })) }
return '' }) }, return '' }),
},
// Post macros... // Post macros...
// //
@ -378,7 +380,8 @@ var macro = {
.end() .end()
// remove js links... // remove js links...
.find('[href]') .find('[href]')
.filter(function(i, e){ return /javascript:/i.test($(e).attr('href')) }) .filter(function(i, e){
return /javascript:/i.test($(e).attr('href')) })
.attr('href', '#') .attr('href', '#')
.end() .end()
.end() .end()
@ -648,8 +651,8 @@ var macro = {
}, },
!isolated))) !isolated)))
//true))) //true)))
.html() .html() })
}).join('\n') })) .join('\n') }))
// post processing... // post processing...
if(!skip_post){ if(!skip_post){
@ -773,8 +776,7 @@ var BaseData = {
'System/delete': function(){ 'System/delete': function(){
var p = this.dir var p = this.dir
delete this.__wiki_data[p] delete this.__wiki_data[p]
return this.get('..') return this.get('..') },
},
//*/ //*/
} }