bugfix + some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-10-30 14:26:35 +03:00
parent fc529da8dc
commit 8e923da7d5
3 changed files with 4 additions and 40 deletions

View File

@ -1418,7 +1418,7 @@ object.Constructor('Page', BasePage, {
renderer: state.renderer, renderer: state.renderer,
} }
// XXX this is ugly, can we avoid this??? // XXX this is ugly, can we avoid this???
yield this.__parser__.resolve(page, yield this.__parser__.parse(page,
this.__parser__.expand(page, this.__parser__.expand(page,
text, _state), _state) text, _state), _state)
} else { } else {
@ -2000,6 +2000,7 @@ module.System = {
+'<hr>' +'<hr>'
+'<macro src="." join="@source(file-separator)">' +'<macro src="." join="@source(file-separator)">'
+'<h1 ' +'<h1 '
+'wikiwords="no" '
+'contenteditable ' +'contenteditable '
// XXX need to make this savable... // XXX need to make this savable...
+'oninput="saveLiveContent(\'@source(s ./path)/name\')">' +'oninput="saveLiveContent(\'@source(s ./path)/name\')">'
@ -2026,32 +2027,7 @@ module.System = {
<slot content> <slot content>
<macro src=".." join="@source(file-separator)"> <macro src=".." join="@source(file-separator)">
<h1 class="title-editor" <h1 class="title-editor"
contenteditable
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
@source(./title)
</h1>
<pre class="editor"
wikiwords="no" wikiwords="no"
contenteditable
oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
><quote filter="quote-tags" src="."/></pre>
</macro>
</slot>`},
// XXX remove when bug (quote getting trash) fixed...
edit_isolated: {
// XXX not sure if we should use .title or .name here...
text: object.doc`
<slot pre>
<title>@source(../title) (edit)</title>
</slot>
<slot parent>../..</slot>
<slot location>@source(../location/!)</slot>
<slot content>
<macro src=".." join="@source(file-separator)" isolated>
<h1 class="title-editor"
contenteditable contenteditable
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)"> oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
@source(./title) @source(./title)

View File

@ -204,7 +204,7 @@ module.BaseParser = {
return a.pop().uncomment return a.pop().uncomment
|| '' }) }, || '' }) },
// Lexically split the string... // Lexically split the string (generator)...
// //
// <item> ::= // <item> ::=
// <string> // <string>
@ -322,7 +322,7 @@ module.BaseParser = {
yield str } yield str }
macro = true } } }, macro = true } } },
// Group block elements... // Group block elements (generator)...
// //
// <item> ::= // <item> ::=
// <string> // <string>

View File

@ -18,18 +18,6 @@
* - CLI - * - CLI -
* *
* *
* XXX BUG: in .system/edit if macro is isolated then @quote(..) will
* for some reason get odd stuff like '[object Object]'...
* these break:
* /QuoteTest/edit_isolated
* /MacroSlotTest/edit_isolated
* these work:
* /QuoteTest/edit
* /MacroSlotTest/edit
* ...can't produce a minimal example (/QuoteTest) other than
* editing .system/edit...
* ...seems that in isolated mode some macros get expanded before/in @quote(..)
* XXX remove .system/edit_isolated when done...
* XXX MACRO: should <macro>'s isolated be on by default??? * XXX MACRO: should <macro>'s isolated be on by default???
* ...do we need to isolate named macros too??? * ...do we need to isolate named macros too???
* ...should this isolation be one-directional??? * ...should this isolation be one-directional???