Closed linonetwo closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
tiddlywiki5 | ✅ Ready (Inspect) | Visit Preview | Jun 18, 2024 11:28am |
This will ignore current tiddler when collecting transclusions.
But this is different from the behavior of backlinks[] !
I would recommend seeing the same behavior for all node filter operator! Different behavior makes it difficult to remember.
@kookma Have a try if you have time, I add more test so it have a higher chance that it works as expected.
I did some tests and all previous issues have gone!
The only odd behavior is both transcludes
and backtranscludes
retune the currentTiddler as a node!
This is meaningless and confusing! So, I would recommend to solve this issue in the code!
That means if you create an empty tiddler with below scripts
<<list-links "[all[current]transcludes[]]">>
<<list-links "[all[current]backtranscludes[]]">>
Tiddlywiki will return
The behavior of links and backlinks is similar, but I will check it later, after I finish my burgerking.
Current behavior in this PR's preview site is the same as links[]
The behavior of links and backlinks is similar, but I will check it later, after I finish my burgerking.
I do not think so! For example, create a new tiddler with below script:
{{{ [all[current]links[]] }}}
It returns nothing!
{{{ [all[current]links[]] }}}
It returns nothing!
IMO wrong code. I think it should be: {{{ [all[current]backlinks[]join[, ]] }}}
If the current tiddler contains a link to itself, it has to report that link if backlinks[]
is used. The same needs to be true for transcludes
and backtranscludes
@kookma -- You are right - If this code is the only thing in a tiddler -> It should create empty lists.
<<list-links "[all[current]transcludes[]]">>
<<list-links "[all[current]backtranscludes[]]">>
Oh, why {{{ [all[current]backtranscludes[]] }}}
won't output tiddler title, but <<list-links
will...
It is same as <<list-links "[all[current]transclusssssdes[]]">>
, the second part is ignored, and output the all[current]
part. Maybe a bug of list-links macro?
This will output nothing <$list filter="[all[current]transcludes[]]" />
<<list-links "[all[current]links[]]">>
works fine, so this must be my bug.
Added detailed rules to handle self-referencial cases, @kookma thank you for finding the test case.
Also outof professional ethics, I refactor links[] transcludes[] related wiki method to a file, so wiki.js won't be too long to edit. @Jermolene
Maybe it worth some time to look at linter related PRs!
Thanks @linonetwo
Thank you! All my previous tests are passed with latest release.
This will ignore current tiddler when collecting transclusions.
But this is different from the behavior of backlinks[] !
Update: restore old behavior: include itself when there is a self-referential transclusion, so it works the same as
backlinks[]