var field = params[0];I'll create a ticket if the consensus is that this change is worthwhile.
var inputType = params[1]? params[1] : "input";
if((tiddler instanceof Tiddler) && field)
{
story.setDirty(tiddler.title,true);
if(field != "text" && inputType != "textarea" )
{
var e = createTiddlyElement(null,"input")
......
}
else
//create text area
Cheers
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
I'd assumed the current behavior was because tiddlers are saved like
so:
<div tiddler="SomeTiddler" modifier="JeremyRuston"
modified="200508181424" created="200508181424" tags="features
options">Stuff from the text area</div>
So, if we can have multiple text areas, where would that text be
stored? In fact, I seem to remember that if I didn't have a text area
then the tiddler save would fail. I could be remembering old data
though.
-Clint
Ah, I see. In fact I guess the current behaviour is because the body
text is the only field that can contain newlines and hence requires a
textarea.
> So, if we can have multiple text areas, where would that text be
> stored? In fact, I seem to remember that if I didn't have a text area
> then the tiddler save would fail. I could be remembering old data
> though.
I interpreted Saq's request as to be able to, say, put the tag listing
in a multiline textarea instead of a singleline input box, rather than
being able to have multiple bodies for a tiddler.
But you have reminded me of an issue that we need to take care of:
making sure that newlines are somehow stripped from the textareas for
storage.
Cheers
Jeremy
> -Clint
> Also, any suggestions for how I could get multiline text working in a field
> in a plugin for instance? Would escapeLineBreaks and unescapeLineBreaks do
> the trick?
Yes, that would be the way to do it, I think. There will be some
tricky rules for which fields get escaped; in 2.2 we will no longer be
escaping line breaks in the body text, thanks to the new support for
<PRE>s in the storeArea.
Cheers
Jeremy
But you have reminded me of an issue that we need to take care of:
making sure that newlines are somehow stripped from the textareas for
storage.