Jermolene/TiddlyWiki5 — pull request #510 by Arlen22 (2014-03-27 22:52:05+00:00)
Title: New tiddlers in the same tiddler

Added my name to the contributors list and updated the tw5.com docs as well, as you mentioned something about documentation. Here is the rest of it:

##fieldmangler.js: Add create param

Desierializes the text in the create attribute. On failure, the desierializer returns a fields list containing only an empty text field, which is good. This only adds the tiddler if it doesn't already exist! Because this is the fieldmangler, the title of the created tiddler is automatically set to the mangleTitle. The tiddler is NOT opened at all.

##navigator.js: handleNewTiddlerEvent()

Changes the handling of the param attribute if it contains a line break. The entire param string is deserielized as application/x-tiddler and the resulting tiddler is used as the template tiddler. This is as opposed to getting the tiddler from the store with only the title. This gets rid of the requirement for a separate template tiddler. This is mostly for hackability. Good plugins should have a separate template tiddler to ease upgrades.

##Rules
###navigator.js

If the param string contains newline characters, it will treat it as application/x-tiddler and deserialize it. It then becomes a template tiddler and goes through the same mechanism.

If the param string does not contain newline characters, it look for a tiddler with that title and use it as the template.

###fieldmangler.js

On execute (whenever that is) the create param is deserialized and the resulting tiddler created, if it does not exist, with the title specified in "tiddler".