Neatening up

This commit is contained in:
Jeremy Ruston 2023-07-30 18:00:17 +01:00
parent 4a39097fee
commit 81679b8514
1 changed files with 4 additions and 8 deletions

View File

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