1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-28 23:10:46 +00:00

Fix importing of function definitions

This commit is contained in:
jeremy@jermolene.com 2022-05-03 09:39:05 +01:00
parent 8f69c27632
commit c4743ebbec
2 changed files with 33 additions and 2 deletions

View File

@ -55,9 +55,11 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
type: "set",
attributes: parseTreeNode.attributes,
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
// current widget instead of adding
// another link to the chain.

View File

@ -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>