I am playing with the jsonget operator.
Everything works as expected, but when I use it on a string with spaces, it returns a link instead of plain text/string:
DatJSON:
{
"1": "String contains spaces",
"2": "StringWithoutSpaces"
}
Tiddler:
<$set name="JSONtest" tiddler="DatJSON">
<$set name="JSONstringSPC" filter="[<JSONtest>jsonget[1]]">
<$set name="JSONstring" filter="[<JSONtest>jsonget[2]]">
<<JSONstringSPC>><br>
<$text text=<<JSONstringSPC>>/>
<<JSONstring>><br>
<$text text=<<JSONstring>>/>
Output:
String contains spaces (linked to non-existent Tiddler “String contains spaces”)
[[String contains spaces]]
StringWithoutSpaces
StringWithoutSpaces
The TextWidget returns a string as supposed, but shows the surrounding brackets instead.
I suspect that this is owed to TiddlyWiki behaviour (surrounding a string with spaces with brackets). Is there an easy way to show only the string with no surrounding brackets?
Retrieving the substring would be a choice, but I hope that there is another one, too.
Is there a way to evaluate the filter expression “[jsonget[1]]” in the advanced-search (filter), too? I don’t know how to assign the JSON structure in the filter.
Any ideas are welcome.
Cheers!