Extremity space in field and tiddler format

I’ve just noticed that if a field in a tiddler begins or ends with a space, the fielder will be saved as json in my tw server setup. The field I remarked it and tested it after spotting this is neither “title”, “tags” or “filetype”. Something like personal “use” or “toto” triggers it.

Here is my $:/config/FileSystemExtensions tiddler:

[field:type[application/x-tiddler-dictionary]then[.dic]]
[field:type[text/vnd.tiddlywiki]then[.tw5]]
[field:type[]then[.tw5]]
[field:type[text/plain]then[.txt]]

That’s right, since the .tid or your .tw5 format cannot define field names with leading or trailing spaces. .JSON can create fields like that. That’s the reason.

The same thing will happen, if fields other than text will contain linebreaks. There is no .tid format at the moment that can handle linebreaks in field-content

-m

Thank you @pmario. But the space is not in the field name but in the field value! My text could be better and so I understand why you answered like you did.

field “foo” with value "spacey " triggers the json format.

Hi @jypre field values with a trailing or leading space force saving as a .json file because .tid files don’t support leading spaces within field values, and trailing spaces can sometimes be removed by external tooling like text editors.

@jeremyruston in fact, the trailing space in my case was a typo and I discovered with surprised my tiddler file in json instead of .tw5.

closed case. Thank you to all of you!

Fyi using the trim operator can help remove leading and trailing spaces.

@TW_Tones Yes, I already use it, and for other things than space. But that’s it with space that you don’t see them. So my json surprise, my testing and finding, my astonishment and this thread as a result.