On Friday, January 10, 2020 at 5:41:52 AM UTC-8, Mohammad wrote:
>
> While Tiddlywiki does not allow to add fileds with space in name or
> uppercase word!
> but it seems the through the $action-setfield it is possible.
>
This does seem like a "hole" in the core handling. Also, when you save and
reload the file,
the upper case letters are automatically re-mapped to lowercase, but the
spaces result
in TWO fields (e.g., "this field" becomes two fields, "this" and "field").
I ran into this problem myself while working on a project, and here's my
"fixup" for it:
<$vars fieldName={{{ [<fieldName>split[ ]join[_]lowercase[]] }}}>
What this does is replace spaces with underscore, and change all uppercase
to lowercase
For example:
<$edit-text tiddler="$:/temp/newfieldname">
<$edit-text tiddler="$:/temp/newfieldvalue">
<$button> make field
<$vars fieldName={{{ [{$:/temp/newfieldname}split[ ]join[_]lowercase[]]
}}}>
<$action-setfield $field=<<fieldName>> $value={{$:/temp/newfieldvalue}}/>
</$vars>
</$button>
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/9dea3673-c277-4558-9224-223e2adf7242%40googlegroups.com.