mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 08:31:38 +00:00
Merge branch 'master' of github.com:flynx/pWiki
This commit is contained in:
commit
f0f4e9a086
27
wiki.js
27
wiki.js
@ -131,7 +131,8 @@ var macro = {
|
||||
return '' }),
|
||||
now: Macro('Create a now id',
|
||||
[],
|
||||
function(context, elem, state){ return ''+Date.now() }),
|
||||
function(context, elem, state){
|
||||
return ''+Date.now() }),
|
||||
// select filter to post-process text...
|
||||
filter: Macro('Filter to post-process text',
|
||||
['name'],
|
||||
@ -172,7 +173,8 @@ var macro = {
|
||||
var path = $(elem).attr('src')
|
||||
|
||||
return context.get(path)
|
||||
.map(function(page){ return page.raw })
|
||||
.map(function(page){
|
||||
return page.raw })
|
||||
.join('\n') }),
|
||||
|
||||
quote: Macro('Include quoted page source (without parsing)',
|
||||
@ -199,7 +201,9 @@ var macro = {
|
||||
|
||||
// XXX
|
||||
text = $(elem).html()
|
||||
text = text == '' ? $(elem).attr('text') : text
|
||||
text = text == '' ?
|
||||
$(elem).attr('text')
|
||||
: text
|
||||
text = this.parse(context, text, state, true)
|
||||
//text = parse(elem)
|
||||
|
||||
@ -211,9 +215,7 @@ var macro = {
|
||||
|
||||
} else if(name in state.slots){
|
||||
state.slots[name] = text
|
||||
return ''
|
||||
}
|
||||
}),
|
||||
return '' } }),
|
||||
//*/
|
||||
// convert @ macro to html-like + parse content...
|
||||
slot: Macro('Define/fill slot',
|
||||
@ -294,7 +296,8 @@ var macro = {
|
||||
parse(e, page)
|
||||
return e[0] })) }
|
||||
|
||||
return '' }) },
|
||||
return '' }),
|
||||
},
|
||||
|
||||
// Post macros...
|
||||
//
|
||||
@ -379,7 +382,8 @@ var macro = {
|
||||
.end()
|
||||
// remove js links...
|
||||
.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', '#')
|
||||
.end()
|
||||
.end()
|
||||
@ -649,8 +653,8 @@ var macro = {
|
||||
},
|
||||
!isolated)))
|
||||
//true)))
|
||||
.html()
|
||||
}).join('\n') }))
|
||||
.html() })
|
||||
.join('\n') }))
|
||||
|
||||
// post processing...
|
||||
if(!skip_post){
|
||||
@ -774,8 +778,7 @@ var BaseData = {
|
||||
'System/delete': function(){
|
||||
var p = this.dir
|
||||
delete this.__wiki_data[p]
|
||||
return this.get('..')
|
||||
},
|
||||
return this.get('..') },
|
||||
//*/
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user