Skip to content

Commit

Permalink
Initial commit (#8843)
Browse files Browse the repository at this point in the history
Fixes #8842
  • Loading branch information
Jermolene authored Dec 22, 2024
1 parent e8d4ce2 commit 664c6fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/modules/widgets/transclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ TranscludeWidget.prototype.execute = function() {
}
this.sourceText = target.text;
this.parserType = target.type;
this._canonical_uri = target._canonical_uri;
// Set the legacy transclusion context variables only if we're not transcluding a variable
if(!this.transcludeVariable) {
var recursionMarker = this.makeRecursionMarker();
Expand Down Expand Up @@ -228,7 +229,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
});
return {
text: parserInfo.text,
type: parserInfo.type
type: parserInfo.type,
_canonical_uri: parserInfo._canonical_uri
};
}
};
Expand Down Expand Up @@ -455,8 +457,11 @@ TranscludeWidget.prototype.makeRecursionMarker = 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
var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{subTiddler:this.transcludeSubTiddler});
return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType)
var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{
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() {
Expand Down
1 change: 1 addition & 0 deletions core/modules/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) {
if(tiddler.fields.type) {
parserInfo.parserType = tiddler.fields.type;
}
parserInfo._canonical_uri = tiddler.fields._canonical_uri;
}
} else if(field) {
if(field === "title") {
Expand Down

0 comments on commit 664c6fd

Please sign in to comment.