mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-27 02:20:28 +00:00
Fix importing of function definitions
This commit is contained in:
parent
8f69c27632
commit
c4743ebbec
@ -55,9 +55,11 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
|||||||
type: "set",
|
type: "set",
|
||||||
attributes: parseTreeNode.attributes,
|
attributes: parseTreeNode.attributes,
|
||||||
params: parseTreeNode.params,
|
params: parseTreeNode.params,
|
||||||
isMacroDefinition: parseTreeNode.isMacroDefinition
|
variableParams: parseTreeNode.variableParams,
|
||||||
|
isMacroDefinition: parseTreeNode.isMacroDefinition,
|
||||||
|
isFunctionDefinition: parseTreeNode.isFunctionDefinition
|
||||||
};
|
};
|
||||||
if (parseTreeNode.isMacroDefinition) {
|
if (parseTreeNode.isMacroDefinition || parseTreeNode.isFunctionDefinition) {
|
||||||
// Macro definitions can be folded into
|
// Macro definitions can be folded into
|
||||||
// current widget instead of adding
|
// current widget instead of adding
|
||||||
// another link to the chain.
|
// another link to the chain.
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
title: CustomWidget-Override-Codeblock
|
||||||
|
description: Usage of genesis widget with attributes starting with dollar signs
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
\import Definition
|
||||||
|
<$codeblock code="Kangaroo"/>
|
||||||
|
<$codeblock code={{Subject}}/>
|
||||||
|
<$let test="Tiger">
|
||||||
|
<$codeblock code=<<test>>/>
|
||||||
|
</$let>
|
||||||
|
_
|
||||||
|
title: Definition
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
\function <$codeblock>(code)
|
||||||
|
<$codeblock code={{{ [<code>addprefix[£]addsuffix[@]] }}}/>
|
||||||
|
\end
|
||||||
|
_
|
||||||
|
title: Subject
|
||||||
|
|
||||||
|
Python
|
||||||
|
_
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p><pre><code>£Kangaroo@</code></pre><pre><code>£Python@</code></pre><pre><code>£Tiger@</code></pre></p>
|
Loading…
Reference in New Issue
Block a user