These files consist of a sequence of lines containing name:value pairs, a blank line and then the text of the tiddler.
The example that follows is most common. But I’m afraid the documentation is not explicit enough about edge cases.
title: Tiddler1
title: Tiddler2
title: Tiddler3
What is the value of text field in each of these cases, when these three tiddlers get imported? Tiddler2 and Tiddler3 have blank lines (no whitespaces, just \n) at the bottom.
When editing each, tid1 is an empty text field I can add things to.
tid2 is the same
tid3 has a blank line (the latest the insert cursor shows is the start of the second line)
Adding a single character to the last possible position within each tid, the files on disk now look like this: (note that node renamed the files to match the capitalisation of the title)
So in context of parsing, as I understand, this translates to:
Cut all lines that are the top of the file, and that have exactly one : pattern (as discussed in the earlier .tid related thread, this somehow hard restriction is to avoid confusing the parser) - these are the fields lines.
When parsing the rest of the file:
If the string is ‘’ - there’s no even blank line separator, and the text field is ‘’ as well.
If the string is ‘\n’ - just one blank line - that is the separator, and still text field is ‘’.
Otherwise skip the blank line separator and everything below it is the text field.
If you import it, only tiddler 2 and 3 should have a text field.
If you open the tiddlers for editing you can not really see how the tiddlers look like, because the edit mode opens a “draft.of” tiddler. If you want to see how the tiddlers look like, you need to go to the browser console F12 and type:
$tw.wiki.getTiddler("Tiddler1")
The fields object contains the info.
Tiddler1 has a title field only
Tiddler2 has a title and text field which is empty