diff --git a/broker.ts b/broker.ts index dcd5e3c..05e69d8 100644 --- a/broker.ts +++ b/broker.ts @@ -134,40 +134,27 @@ function render(node: Node): string { return ""; } - console.log("Render node " + node.type); + console.log("Render node 3 " + node.type); var outputHTML: string = ""; // type: "Root" | "Hexagram" | "Judgement" | "Images" | "ChangingLines" ; + + switch (node.type) { case "Root": return render(node.child!); //case "Hexagram": default: outputHTML = "
" + node.value + "
"; - outputHTML.concat(render(node.child!)); + //outputHTML.concat(render(node.child!)); + outputHTML = outputHTML + render(node.child!); + + console.log(" " + node.type + " - outputHTML: " + outputHTML); + return outputHTML; } - //return ""; } - -/* -//TODO: process every line... -function processLine(inputLine: string): string { - - if (inputLine.startsWith('Hexagram')) { - return processLineHexagram(inputLine); - } - - //return input + "\n"; - //"${content}
" - return "" + inputLine + "
"; -} - -function processLineHexagram(inputLine: string): string { - - return "" + inputLine + "
"; -}*/ \ No newline at end of file