mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-23 11:47:38 +00:00
Cache parse trees when transcluding variables
This commit is contained in:
@@ -171,7 +171,13 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
if(this.transcludeVariable) {
|
||||
var variableInfo = this.getVariableInfo(this.transcludeVariable).srcVariable;
|
||||
if(variableInfo) {
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock});
|
||||
var mode = this.parseTreeNode.isBlock ? "blockParser" : "inlineParser";
|
||||
if(variableInfo[mode]) {
|
||||
parser = variableInfo[mode];
|
||||
} else {
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock});
|
||||
variableInfo[mode] = parser;
|
||||
}
|
||||
if(parser && variableInfo.isFunctionDefinition) {
|
||||
parser = {
|
||||
tree: [
|
||||
|
Reference in New Issue
Block a user