ListWidget Bug?

55 views
Skip to first unread message

Jared Lettau

unread,
Feb 13, 2020, 3:22:39 PM2/13/20
to TiddlyWiki
Hi all,

When spaces or single return char separate <$list...> from </$list>, no results or emptyMessage are returned. The widget documentation doesn't indicate that this is expected behavior. Bug?




Example tiddler output: (in case the link ever dies)

List Bug?

13th February 2020 at 12:12pm
  1. No whitespace:
    <$list filter="[title[foo]]"></$list>

    foo

  2. Single space (U+0020 : SPACE [SP]):
    <$list filter="[title[foo]]"> </$list>

  3. Two spaces (U+0020 : SPACE [SP]):
    <$list filter="[title[foo]]">  </$list>

  4. Character return:
    <$list filter="[title[foo]]">
    </$list>

  5. Double space (2 returns):
    <$list filter="[title[foo]]">
    
    </$list>

Mark S.

unread,
Feb 13, 2020, 3:34:55 PM2/13/20
to TiddlyWiki
It's a known anomaly. List widget uses whatever is between <$list> and </$list> as a template. If there is nothing
(not even a space) then it uses it's own default template. But if there is even a single space, then it uses
"space" as the template.

The reason double-space works is because .... hmm ... legacy reasons, I think.

TonyM

unread,
Feb 13, 2020, 4:29:08 PM2/13/20
to TiddlyWiki
Jarard,

So something you can take from Marks point is you can make your own template which handles this however you wish (within limits).

use the template=tiddler  parameter on the list widget

For inspiration look at the one that is (most likey) used by default $:/core/ui/ListItemTemplate
<div class="tc-menu-list-item">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</div>
and make your own.

Also,

How were you inserting your special characters?

Did you try the html method described here https://tiddlywiki.com/#decodehtml%20Operator 
&nbsp;

Regards
Tony

Mat

unread,
Feb 13, 2020, 5:33:05 PM2/13/20
to TiddlyWiki
Mark S. wrote:
The reason double-space works is because .... hmm ... legacy reasons, I think.

There's also a practical reason: No space outputs something styled as "display:inline" whereas double space outputs "display:block". For example no space would give output

aaabbbccc

and double space

aaa
bbb
ccc

<:-)

Mark S.

unread,
Feb 13, 2020, 5:42:53 PM2/13/20
to TiddlyWiki
That explains formatting. It doesn't explain why double line feeds use the default template. I think that goes back to legacy.

Mat

unread,
Feb 13, 2020, 6:54:58 PM2/13/20
to TiddlyWiki
Mark S. wrote:
That explains formatting. It doesn't explain why double line feeds use the default template. I think that goes back to legacy.

There is some very old issue about formatting when transcluding, causing things to end up as inline when one wants block. (Maybe someone can phrase this better, I'm unsure how to describe it precisely). Is the double line feed not required for block to show - and, if I recall, Jeremy is not quite sure of why? (I quite possibly don't remember this correctly.)

<:-)

P.S ...why the hey is there a "1." at the bottom of my posts in this thread???? I can't delete it in the google groups editor!?
Reply all
Reply to author
Forward
0 new messages