Delimiting parameters with = and : can brick your wiki

I am now waiting for a wiki of mine to return control to me. I accidently placed a param:"value" inside a $macrocall widget, when it should be param="value" I think this has being raised before but is there any reason why : and = could not be used interchangeably in macro and widget calls? I cant think why not off the top of my head.

  • Alternatively we could try and trap this error or simply don’t render such cases.
  • Was there ever a reason for this distinction?

In some ways its one of those little single character errors you can make that will “brick your wiki”, and it understandably suggests tiddlywiki is fragile. In fact I was forced to close my browser, and wait quite a long time to be able to reopen it.

  • Now since this occurred through the preview/output view I need to find a way to correct the problem without opening the tiddler in the story.

Which macro did you call?

I did create an issue at Gitub so we do not forget about it. But it would be important to be able to replicate the issue.

Mario, the tiddler that contained this was such a problem I had to work very hard to fix the wiki.

So I do not have access to an example, but you can see here different results.

\define macro(value) Show $(value)$
# <$macrocall $name=macro value:"value"/>
# <$macrocall $name=macro value:value value2:value/>

Perhaps the serious error is a fringe case, If I can identify it I will put up an issue.

In the mean time the need to use a specific seperator could be changed, but is it technicaly possible?

Regards
Tones

I did have a similar problem once, with a macro parameter, where the default value of the first or seconde parameter was currentTiddler. Because of this default it did run into a transclusion recursion error.

So in my case it did take some time, but it did recover after 30 seconds or so.

I did use the console to add a code-body: yes field to the tiddler. So it could be opened in view-mode, without the recursion error.

The following code can be used in the browser console F12
It adds the code-body: yes field to the HelloThere tiddler

$tw.wiki.addTiddler(new $tw.Tiddler($tw.wiki.getTiddler("HelloThere"), {"code-body":"yes"})); 

Hope that helps for the next time.
-m

1 Like

For v5.4.0 it is intended to consolidate the parameter syntax between widgets and procedures, for details see Dynamic parameters for macro/procedure/function calls by Jermolene · Pull Request #9055 · TiddlyWiki/TiddlyWiki5 · GitHub

1 Like

Fantastic!

@TW_Tones I feel your pain, and appreciate the post. Goodness knows how many times I’ve been troubleshooting and second-guessing the logic of my variables and nested list structures etc., only to notice — after nearly pulling my hair out — that the problem was just that I had swapped = for :.

1 Like