[TW5] Can a field contain multiple lines in the node.js version of TW5?

167 views
Skip to first unread message

Novan Leon

unread,
Feb 3, 2017, 11:58:43 PM2/3/17
to TiddlyWikiDev
I'm running TW5 in node.js on my local computer.

I created a new tiddler with the following code and tagged it with $:/tags/EditTemplate:

<$edit-text field="url" class="tc-edit-texteditor" tag="textarea"/>

This adds a new field to the edit template that allows me assign one or more lines of text to the "url" field.

This works splendidly until I close and reload tiddlywiki in node.js. It doesn't seem to know how to handle multiple lines in the url field and transfers a portion of the url field (anything after the first line) to the text field.

For examples see the attached files. Open the tiddler "Test Bookmark 8" and look at the url and text fields. Perform a reload and you'll see them switch.

Is anyone familiar with this issue? Is this just a limitation of using node.js? It doesn't seem to be an issue in TW5-proper (probably since fields are properties within an object instead of text in a file);

PS. This is what the TW file in question looks like:

created: 20170129190757979
modified
: 20170204044611332
tags
: happy simple test fun out other
title
: Test Bookmark 8
type
: text/vnd.tiddlywiki
url
: https://s-media-cache-ak0.pinimg.com/originals/13/27/a9/1327a9d18600c896d3a4ad5bada1e5e4.jpg

This is another URL:
https
://teespring-storecontent.s3.amazonaws.com/As0cmYmwPdduXekmbKpOIg_store_header_image

This is the text field.




tiddlywiki_before.html
Test_Bookmark_8.tid
tiddlywiki_after.html

PMario

unread,
Feb 4, 2017, 6:07:22 AM2/4/17
to TiddlyWikiDev
Hi,

Fields can't handle multi line content. It's not designed that way.

It would be easier, if you describe, what you want to achieve, So if you describe your usecase a bit, we may be able to help,

-m

Jeremy Ruston

unread,
Feb 4, 2017, 10:14:02 AM2/4/17
to tiddly...@googlegroups.com
Hi Novan

This works splendidly until I close and reload tiddlywiki in node.js. It doesn't seem to know how to handle multiple lines in the url field and transfers a portion of the url field (anything after the first line) to the text field.

There is a known limitation whereby multi-line fields are not saved correctly in .tid files. There’s a github ticket here:


Thus, at the moment, the “text” field is the only field you can safely use with multi-line content,

Best wishes

Jeremy


For examples see the attached files. Open the tiddler "Test Bookmark 8" and look at the url and text fields. Perform a reload and you'll see them switch.

Is anyone familiar with this issue? Is this just a limitation of using node.js? It doesn't seem to be an issue in TW5-proper (probably since fields are properties within an object instead of text in a file);

PS. This is what the TW file in question looks like:

created: 20170129190757979
modified
: 20170204044611332
tags
: happy simple test fun out other
title
: Test Bookmark 8
type
: text/vnd.tiddlywiki
url
: https://s-media-cache-ak0.pinimg.com/originals/13/27/a9/1327a9d18600c896d3a4ad5bada1e5e4.jpg

This is another URL:
https
://teespring-storecontent.s3.amazonaws.com/As0cmYmwPdduXekmbKpOIg_store_header_image

This is the text field.





--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/ae0047a9-a00c-4d83-9438-fb9242ce34d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<tiddlywiki_before.html><Test_Bookmark_8.tid><tiddlywiki_after.html>

Novan Leon

unread,
Feb 4, 2017, 10:24:46 AM2/4/17
to TiddlyWikiDev
Well, essentially I'm trying to create a second, freely editable textarea field similar to the text field. This is relatively simple to do in TWC so I'm trying to replicate the functionality here.

The goal is to be able to list one or more URLs in that textarea, as well as line breaks and other notes if desired, for information management purposes.

For example, to create a tiddler like the following:

title:
James Cameron

urls:
Information:
http
://www.imdb.com/name/nm0000116/?ref_=fn_al_nm_1
https
://en.wikipedia.org/wiki/James_Cameron
https
://www.rottentomatoes.com/celebrity/james_cameron/

Photos:
https
://www.google.com/search?q=james+cameron&tbm=isch

text:
James Cameron is an accomplished writer, director, producer, engineer, inventor and deep-sea explorer.

James Francis Cameron was born on August 16, 1954 in Kapuskasing, Ontario, Canada. He moved to the United States in 1971.

I want to keep the url and text fields separate for presentation reasons, for one, but also because I intend to parse the url field and automatically generate different UI elements depending on the contents. I've already accomplished all of these goals in TWC, now I'm just trying to create like for like functionality in TW5 (at so it appears that way to the user).

My immediate though is to create a custom $edit-text wiki that replaces carriage returns/newlines with their shorthand equivalent (/r, /n) when saving to preserve formatting. Unless there is possibly a better solution available?

Novan Leon

unread,
Feb 4, 2017, 10:35:32 AM2/4/17
to tiddly...@googlegroups.com
Jeremy,

Thanks. You confirmed by suspicions but I didn't realize there was an active ticket open for this.

It probably should have occurred to me earlier, but I'll have include the github issues list as one of my resources when researching these challenges.

- Novan
Message has been deleted

Tobias Beer

unread,
Dec 10, 2017, 2:05:31 AM12/10/17
to TiddlyWikiDev
Hi Novan,

What you can do for now is create a "twin tiddler" anywhere you want, possibly under a system name space and store the related details in there while showing it in some extra view template section.

So,

Developer

may be accompanied by:

$:/_x-text/Developer

-tb 
Reply all
Reply to author
Forward
0 new messages