Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
#227 -- renamed process() to processRecursively() and added some TODOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanHoladay committed Aug 22, 2023
1 parent 57615b9 commit 27a8c06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions website/custom-preprocessor/transition-preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ export default class TransitionPreprocessor {
content.search(/<style>/)
);

const html = this.process(markup);
//TODO: Fix this ambiguous temporal coupling; probably should pass script and style to process()
const html = this.processRecursively(markup);
const code = this.scriptContent + html + this.styleContent;

//TODO: add source map?
return { code: code };
}

process(markup: string) {
processRecursively(markup: string) {
const inlineCompTagPos = markup.search(/<[A-Z]/);
let result = '';

Expand All @@ -61,12 +63,12 @@ export default class TransitionPreprocessor {
this.scriptContent = this.writeTransFnToScript(this.scriptContent, transition, ref);

result += component;
result += this.process(
result += this.processRecursively(
markup.slice(inlineCompTagPos + this.getComponentCloseTagEnd(origComp) + 1)
);
} else {
result += component;
result += this.process(
result += this.processRecursively(
markup.slice(inlineCompTagPos + this.getComponentCloseTagEnd(component) + 1)
);
}
Expand Down

0 comments on commit 27a8c06

Please sign in to comment.