TiddlyWikiClassic icon indicating copy to clipboard operation
TiddlyWikiClassic copied to clipboard

Transcluded sections do not get refreshed.

Open Skeeve opened this issue 11 years ago • 3 comments

I used a <<tiddler "transcluded#Section">> in one of my tiddlers.

When the section, or the "transcluded" tiddler changes, the transcluded section does not get refreshed. (see https://groups.google.com/forum/?fromgroups=#!topic/tiddlywiki/lSbd2_J6JWc for an example)

I'm not sure, but I THINK I fixed it.

I imported the CoreTweaks and changed in the tweak to ticket 1147

This line: if(force != null || changeList == null || changeList.indexOf(title) != -1) {

to this line if(force != null || changeList == null || changeList.indexOf(title.replace(/##.*/,'')) != -1) {

This will remove the "##Section" part from the tiddler name and thus make a transcluded section refresh.

Skeeve avatar Apr 15 '13 05:04 Skeeve

related: https://groups.google.com/d/msg/tiddlywiki/W4_yyzmgeEA/dVmGCBtUCSgJ

to reproduce

[[PartlyTranscluded]]
!Section1
not transcluded
!Section2
transcluded
!End

[[transcluding]]
<<tiddler [[PartlyTranscluded##Section2]]>>

pmario avatar May 05 '13 20:05 pmario

possible solution: https://groups.google.com/forum/?hl=de&fromgroups=#!topic/tiddlywiki/Nm0DhKdVmqQ

pmario avatar May 05 '13 20:05 pmario

Preliminary info: probably can be fixed by changing config.refreshers .tiddler: substitute

var title = e.getAttribute("tiddler");

with something like

var title = e.getAttribute("tiddler");
var separatorIndex = title.indexOf(config.textPrimitives.sliceSeparator);
if(separatorIndex == -1)
    separatorIndex = title.indexOf(config.textPrimitives.sectionSeparator);
if(separatorIndex != -1)
    title = title.substr(0,separatorIndex);

to do:

  • test if this fixes the issue
  • explore if this is a proper fix or the tiddler attribute of the span generated by tiddler macro should have another value (title instead of title##section) in the first place (unlikely, at least in terms of backward compability

PS for myself: see also TransclusionFixesPlugin, "TransclusionContextFix" part where I hijack config.macros.tiddler.renderText instead, seems to be a weird approach. Also the fix should cover slider and tabs macros.

YakovL avatar Sep 12 '18 11:09 YakovL