1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 19:39:57 +00:00
TiddlyWiki5/editions/test/tiddlers/tests/data/functions/WikifiedFunctions.tid
jeremy@jermolene.com 34afe4e143 Refactor function invocation
* Introduce new widget helper function to evaluate variables.Functions are evaluated as parameterised filter strings, macros as text with textual substitution of parameters and variables, and procedures and widgets as plain text
* Refactor the function operator and unknown operator to use the new helper
* Use the new helper to evaluate variables within filter strings, thus fixing a bug whereby functions called in such a way were being returned as plain text instead of being evaluated
* Refactor the transclude widget to use the new helper
* Update tests
2023-01-21 22:07:34 +00:00

36 lines
986 B
Plaintext

title: Functions/WikifiedFunctions
description: Wikified functions
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
\function fn-buffalo(param)
[<param>addsuffix[ with a ''buffalo'']]
\end
\procedure proc-buffalo(param)
<<param>> with a ''buffalo''
\end
\define macro-buffalo(param)
$param$ with a ''buffalo''
\end
<<fn-buffalo "Going to lunch">>
<<proc-buffalo "Going to breakfast">>
<<macro-buffalo "Going to dinner">>
<$transclude $variable="fn-buffalo" param="Going to lunch" $output="text/plain"/>
<$transclude $variable="proc-buffalo" param="Going to breakfast" $output="text/plain"/>
<$transclude $variable="macro-buffalo" param="Going to dinner" $output="text/plain"/>
+
title: ExpectedResult
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a buffalo with a buffaloGoing to dinner with a buffalo