1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-08 00:10:27 +00:00

Initial commit

Fixes #8842
This commit is contained in:
Jeremy Ruston 2024-12-22 13:47:57 +00:00
parent e8d4ce2ad0
commit b5030abe9e
2 changed files with 9 additions and 3 deletions

View File

@ -101,6 +101,7 @@ TranscludeWidget.prototype.execute = function() {
} }
this.sourceText = target.text; this.sourceText = target.text;
this.parserType = target.type; this.parserType = target.type;
this._canonical_uri = target._canonical_uri;
// Set the legacy transclusion context variables only if we're not transcluding a variable // Set the legacy transclusion context variables only if we're not transcluding a variable
if(!this.transcludeVariable) { if(!this.transcludeVariable) {
var recursionMarker = this.makeRecursionMarker(); var recursionMarker = this.makeRecursionMarker();
@ -228,7 +229,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
}); });
return { return {
text: parserInfo.text, text: parserInfo.text,
type: parserInfo.type type: parserInfo.type,
_canonical_uri: parserInfo._canonical_uri
}; };
} }
}; };
@ -455,8 +457,11 @@ TranscludeWidget.prototype.makeRecursionMarker = function() {
TranscludeWidget.prototype.parserNeedsRefresh = function() { TranscludeWidget.prototype.parserNeedsRefresh = function() {
// Doesn't need to consider transcluded variables because a parent variable can't change once a widget has been created // Doesn't need to consider transcluded variables because a parent variable can't change once a widget has been created
var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{subTiddler:this.transcludeSubTiddler}); var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{
return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType) subTiddler: this.transcludeSubTiddler,
defaultType: this.transcludeType
});
return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType || parserInfo._canonical_uri !== this._canonical_uri);
}; };
TranscludeWidget.prototype.functionNeedsRefresh = function() { TranscludeWidget.prototype.functionNeedsRefresh = function() {

View File

@ -1132,6 +1132,7 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) {
if(tiddler.fields.type) { if(tiddler.fields.type) {
parserInfo.parserType = tiddler.fields.type; parserInfo.parserType = tiddler.fields.type;
} }
parserInfo._canonical_uri = tiddler.fields._canonical_uri;
} }
} else if(field) { } else if(field) {
if(field === "title") { if(field === "title") {