mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 02:27:19 +00:00
Cache parse trees when transcluding variables
This commit is contained in:
parent
719a5614cb
commit
e99137f4cc
@ -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: [
|
||||
|
@ -23,7 +23,10 @@ title: TiddlerOne
|
||||
<$mywidget one="Dingo">
|
||||
Crocodile
|
||||
</$mywidget>
|
||||
<$mywidget one="BumbleBee">
|
||||
Squirrel
|
||||
</$mywidget>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>DingoCrocodile</p>
|
||||
<p>DingoCrocodileBumbleBeeSquirrel</p>
|
Loading…
Reference in New Issue
Block a user