From a36f425491aaf019243a31179e80cb10ea62db59 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 21 Jun 2021 20:05:08 -0400 Subject: (mkosarek) Transpiling code snippets in a shotty way, but it is good enough --- transpiler/transpiler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'transpiler/transpiler.cpp') diff --git a/transpiler/transpiler.cpp b/transpiler/transpiler.cpp index 5c1de66..a171fc6 100644 --- a/transpiler/transpiler.cpp +++ b/transpiler/transpiler.cpp @@ -1,6 +1,7 @@ #include "MyString.h" #include "List.h" #include "Logger.h" +#include "replacer.h" #include #include #include @@ -149,7 +150,6 @@ int main() { servedFiles.add(pathCopy); otherSb.clear(); - while (line[0] != '\n') { if (line[0] != '\"') { otherSb.addChar(line[0]); @@ -215,7 +215,10 @@ int main() { char* bodyContent = new char[fsize + 1]; fread(bodyContent, 1, fsize, contentFile); bodyContent[fsize] = '\0'; - sb.addStr(bodyContent); + + auto processedBody = insertCodeSnippets(contentFileName.getValue(), bodyContent); + + sb.addStr(processedBody.c_str()); delete [] bodyContent; -- cgit v1.2.1