mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
@quote( .. else="..") now works correctly...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b6cf3a98c9
commit
b68959e2d6
@ -1219,6 +1219,7 @@ object.Constructor('Page', BasePage, {
|
|||||||
// macro with one exception, when used in quote, the body is
|
// macro with one exception, when used in quote, the body is
|
||||||
// not expanded...
|
// not expanded...
|
||||||
// NOTE: the filter argument uses the same filters as @filter(..)
|
// NOTE: the filter argument uses the same filters as @filter(..)
|
||||||
|
// NOTE: else argument implies strict mode...
|
||||||
//
|
//
|
||||||
// XXX need a way to escape macros -- i.e. include </quote> in a quoted text...
|
// XXX need a way to escape macros -- i.e. include </quote> in a quoted text...
|
||||||
// XXX should join/else be sub-tags???
|
// XXX should join/else be sub-tags???
|
||||||
@ -1231,7 +1232,9 @@ object.Constructor('Page', BasePage, {
|
|||||||
var text = args.text
|
var text = args.text
|
||||||
?? body
|
?? body
|
||||||
?? []
|
?? []
|
||||||
var strict = args.strict ?? false
|
var strict = !!(args.strict
|
||||||
|
?? args['else']
|
||||||
|
?? false)
|
||||||
// parse arg values...
|
// parse arg values...
|
||||||
src = src ?
|
src = src ?
|
||||||
await base.parse(src, state)
|
await base.parse(src, state)
|
||||||
@ -1267,7 +1270,7 @@ object.Constructor('Page', BasePage, {
|
|||||||
pages = ((!pages
|
pages = ((!pages
|
||||||
|| pages.length == 0)
|
|| pages.length == 0)
|
||||||
&& args['else']) ?
|
&& args['else']) ?
|
||||||
base.parse(args['else'], state)
|
[await base.parse(args['else'], state)]
|
||||||
: pages
|
: pages
|
||||||
// empty...
|
// empty...
|
||||||
if(!pages || pages.length == 0){
|
if(!pages || pages.length == 0){
|
||||||
@ -2442,7 +2445,7 @@ module.System = {
|
|||||||
<span class="title-editor"
|
<span class="title-editor"
|
||||||
wikiwords="no"
|
wikiwords="no"
|
||||||
contenteditable
|
contenteditable
|
||||||
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
|
oninput="saveContent('@source(s ./path)/title', this.innerText)">
|
||||||
@source(./title/quote)
|
@source(./title/quote)
|
||||||
</span>
|
</span>
|
||||||
@macro(src="."
|
@macro(src="."
|
||||||
@ -2454,16 +2457,17 @@ module.System = {
|
|||||||
<pre class="editor"
|
<pre class="editor"
|
||||||
wikiwords="no"
|
wikiwords="no"
|
||||||
contenteditable
|
contenteditable
|
||||||
oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
|
oninput="saveLiveContent('@source(s ./path)', this.innerText)"
|
||||||
><quote
|
><quote
|
||||||
filter="quote-tags"
|
filter="quote-tags"
|
||||||
src="."
|
src="."
|
||||||
else="@source(@arg(template @slot(editor-template .)))"
|
else="@source('@arg(template .)')"
|
||||||
|
<!--else="@source('@arg(template @slot(editor-template .))')"-->
|
||||||
/></pre>
|
/></pre>
|
||||||
</macro>
|
</macro>
|
||||||
<macro editor join="@source(file-separator)">
|
<macro editor join="@source(file-separator)">
|
||||||
@macro(titleeditor .)
|
@macro(titleeditor .:$ARGS)
|
||||||
@macro(texteditor .)
|
@macro(texteditor .:$ARGS)
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
<slot pre>
|
<slot pre>
|
||||||
@ -2473,7 +2477,7 @@ module.System = {
|
|||||||
<slot location>@source(../location/quote/!)</slot>
|
<slot location>@source(../location/quote/!)</slot>
|
||||||
<slot edit/>
|
<slot edit/>
|
||||||
<slot content>
|
<slot content>
|
||||||
<macro editor src=".." />
|
<macro editor src="..:$ARGS" />
|
||||||
</slot>`},
|
</slot>`},
|
||||||
// XXX EXPERIMENTAL...
|
// XXX EXPERIMENTAL...
|
||||||
ed: {
|
ed: {
|
||||||
@ -2938,8 +2942,7 @@ for(var i=0; i<PAGES; i++){
|
|||||||
var Config =
|
var Config =
|
||||||
module.Config = {
|
module.Config = {
|
||||||
Import: {
|
Import: {
|
||||||
text: '<input type="file" onchange="importData()" accept=".json, .pwiki">'
|
text: '<input type="file" onchange="importData()" accept=".json, .pwiki">' },
|
||||||
},
|
|
||||||
// XXX need an import button...
|
// XXX need an import button...
|
||||||
Export: {
|
Export: {
|
||||||
text: '<button onclick="exportData()">Export</button>' },
|
text: '<button onclick="exportData()">Export</button>' },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user