1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-28 00:40:01 +00:00
Robin Munn 758089cbb3
Alternate fix for inconsistent list template syntax (#7827)
* Alternate fix for inconsistent list template syntax

First attempt, which fails on the ListWidget/WithMissingTemplate test.

* Make WithMissingTemplate test pass, inefficiently

Unfortunately, this ends up being very inefficient, because the
clone-and-mutate logic is repeated for every list item. Not ideal.

* More efficient way to do it

This also makes the failing test pass, but far more efficiently.

* Improve performance of list template discovery

Since parse tree nodes never change after widget creation (whereas
attribute values *can* change), we can safely search for the explicit
list templtaes only once, at widget creation time. This saves time as
the search doesn't have to be done on each re-render, and also allows us
to safely do a clone-and-mutate step to extract the list widget's body
(if any) without any `$list-empty` or other items. That, in turn, allows
using the list widget's body as the template even if `$list-empty` is
specified inside the widget body.
2023-11-06 21:18:31 +00:00
..
2014-04-27 20:03:33 +01:00
2023-04-19 11:55:25 +01:00
2021-10-02 16:17:07 +01:00
2023-03-10 09:41:36 +00:00
2013-11-10 19:22:10 +00:00
2021-10-30 11:42:22 +01:00