This commit is contained in:
parent
768c91e0b3
commit
1d0955c17d
1 changed files with 8 additions and 21 deletions
29
broker.ts
29
broker.ts
|
@ -134,40 +134,27 @@ function render(node: Node): string {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Render node " + node.type);
|
console.log("Render node 3 " + node.type);
|
||||||
|
|
||||||
var outputHTML: string = "";
|
var outputHTML: string = "";
|
||||||
|
|
||||||
// type: "Root" | "Hexagram" | "Judgement" | "Images" | "ChangingLines" ;
|
// type: "Root" | "Hexagram" | "Judgement" | "Images" | "ChangingLines" ;
|
||||||
|
|
||||||
|
|
||||||
switch (node.type) {
|
switch (node.type) {
|
||||||
case "Root":
|
case "Root":
|
||||||
return render(node.child!);
|
return render(node.child!);
|
||||||
//case "Hexagram":
|
//case "Hexagram":
|
||||||
default:
|
default:
|
||||||
outputHTML = "<p>" + node.value + "</p>";
|
outputHTML = "<p>" + node.value + "</p>";
|
||||||
outputHTML.concat(render(node.child!));
|
//outputHTML.concat(render(node.child!));
|
||||||
|
outputHTML = outputHTML + render(node.child!);
|
||||||
|
|
||||||
|
console.log(" " + node.type + " - outputHTML: " + outputHTML);
|
||||||
|
|
||||||
return outputHTML;
|
return outputHTML;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
//TODO: process every line...
|
|
||||||
function processLine(inputLine: string): string {
|
|
||||||
|
|
||||||
if (inputLine.startsWith('Hexagram')) {
|
|
||||||
return processLineHexagram(inputLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
//return input + "\n";
|
|
||||||
//"<p> ${content} </p>"
|
|
||||||
return "<p>" + inputLine + "</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
function processLineHexagram(inputLine: string): string {
|
|
||||||
|
|
||||||
return "<p>" + inputLine + "</p>";
|
|
||||||
}*/
|
|
||||||
|
|
Loading…
Reference in a new issue