1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-14 05:44:50 +00:00

Neatening up

This commit is contained in:
Jeremy Ruston 2023-07-30 18:00:17 +01:00
parent 4a39097fee
commit 81679b8514

View File

@ -56,23 +56,17 @@ TranscludeWidget.prototype.execute = function() {
case "text/html":
// Return the parse tree nodes of the target
target = this.parseTransclusionTarget(parseAsInline);
this.sourceText = target.text;
this.parserType = target.type;
this.parseAsInline = target.parseAsInline;
parseTreeNodes = target.parseTreeNodes;
break;
case "text/raw":
// Just return the raw text
target = this.getTransclusionTarget();
this.sourceText = target.text;
this.parserType = target.type;
parseTreeNodes = [{type: "text", text: this.sourceText}];
parseTreeNodes = [{type: "text", text: target.text}];
break;
default:
// "text/plain" is the plain text result of wikifying the text
target = this.parseTransclusionTarget();
this.sourceText = target.text;
this.parserType = target.type;
target = this.parseTransclusionTarget(parseAsInline);
var widgetNode = this.wiki.makeWidget(target.parser,{
parentWidget: this,
document: $tw.fakeDocument
@ -82,6 +76,8 @@ TranscludeWidget.prototype.execute = function() {
parseTreeNodes = [{type: "text", text: container.textContent}];
break;
}
this.sourceText = target.text;
this.parserType = target.type;
// Set the legacy transclusion context variables only if we're not transcluding a variable
if(!this.transcludeVariable) {
var recursionMarker = this.makeRecursionMarker();