1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-30 01:03:16 +00:00

Refactor missing transclusion target

This commit is contained in:
Jeremy Ruston 2023-07-27 18:48:01 +01:00
parent c4fc3168d1
commit 2c58a0ac71

View File

@ -269,22 +269,12 @@ TranscludeWidget.prototype.getTransclusionTarget = function(parseAsInline) {
});
}
// Return the parse tree
if(parser) {
return {
parseTreeNodes: parser.tree,
parseAsInline: parseAsInline,
text: parser.source,
type: parser.type
};
} else {
// If there's no parse tree then return the missing slot value
return {
parseTreeNodes: (this.slotFillParseTrees["ts-missing"] || []),
parseAsInline: parseAsInline,
text: null,
type: null
};
}
return {
parseTreeNodes: parser ? parser.tree : (this.slotFillParseTrees["ts-missing"] || []),
parseAsInline: parseAsInline,
text: parser && parser.source,
type: parser && parser.type
};
};
/*