TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.04k stars 1.19k forks source link

[BUG] In parsing of transclusion in widget attributes #8124

Open mklauber opened 7 months ago

mklauber commented 7 months ago

Describe the bug

For some reason, when a httprequest is made via <$action-sendmessage $message="tm-http-request"..., query parameters provided by query-* values that use transclusions require removing spaces around the transclusion string. Essentially query-data={{param}} works, but query-data={{ param }} doesn't.

Expected behavior

Query parameters can use the same transclusion strings that can be used elsewhere, including with spaces between the curly braces and contents

To Reproduce

Import the following tiddlers. tiddlers.json

Looking at the two [[Working Example]] and [[Broken Example]] tiddlers, open the web developer tools, switch to the network tab, and compare the request between the two buttons.

Screenshots

image

TiddlyWiki Configuration

Desktop (please complete the following information):

Additional context

No response

btheado commented 7 months ago

It doesn't look like anything specific to $action-sendmessage. It is any use of the transclude version of attribute values

This

{{ param }} - {{param}}

<$text text={{ param }}/> - <$text text={{param}}/>

renders as

Value - Value
- Value

The parsing must be different for the transclude widget shorthand vs. attribute values.

mklauber commented 7 months ago

Good find.