TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.04k stars 1.19k forks source link

[BUG] toc-macros have still 1 text substitution: $sort$ -- So caching is prevented #6826

Open pmario opened 2 years ago

pmario commented 2 years ago

Describe the bug

As the title says: toc-macros have still 2 text substitution: $sort$ and $unselectedText$ -- So caching is disabled

It is hard to fix, since the sort parameter is not a "valid filter" string by itself. It is only a partial eg: sort[title] as shown in the docs

sort An optional extra filter step, e.g. sort[title]

@Jermolene @saqimtiaz ... Any ideas

Expected behavior

No response

To Reproduce

No response

Screenshots

image

TiddlyWiki Configuration

V 5.2.3-pre

Additional context

No response

pmario commented 2 years ago

Just found $unselectedText$ too. OP updated

saqimtiaz commented 2 years ago

@pmario I have the same problem in some of my own work.

We should consider deprecating older macros - for instance timeline as well - that use text substitution and filter steps as parameters once we have #6666 merged, which will also give us the flexibility of custom filter operators. We can provide newer optimized macros as an alternative.

6423 was also prompted by the desire to avoid text substitution in filters when needing to switch between !sort[] and sort[]

Jermolene commented 2 years ago

Hi @pmario I think @saqimtiaz is correct, we will have to eventually deprecate core macros that require text substitution.

pmario commented 2 years ago

Hi @pmario I think @saqimtiaz is correct, we will have to eventually deprecate core macros that require text substitution.

hmmm. ... We do have a deprecated function since April 2018 ... but it is still part of the core.

Jermolene commented 2 years ago

hmmm. ... We do have a deprecated function since April 2018 ... but it is still part of the core.

That's the plan! The idea is that we gradually deprecate more and and more of the old stuff until we get to the point where it is worthwhile jettisoning the old stuff. The deprecation is gradual, but the jettisoning should be a big bang.