Small clean-up

master
Melroy van den Berg 2020-11-29 00:27:10 +01:00
parent 5d7f666103
commit 4d00c7bf05
4 changed files with 5 additions and 7 deletions

View File

@ -38,13 +38,12 @@ void MainWindow::setupParser()
parser = new Parser();
std::string exePath = n_fs::current_path().string();
std::string htmlOutput = "";
std::string filePath = exePath.append("/../../test.md");
printf("Path: %s\n", filePath.c_str());
cmark_node *root_node = parser->parseFile(filePath);
if (root_node != NULL) {
htmlOutput = parser->renderHTML(root_node);
// For HTML: parser->renderHTML(root_node);
// Render AST to drawing area
m_renderArea.renderDocument(root_node);
cmark_node_free(root_node);

View File

@ -38,13 +38,13 @@ cmark_node * Parser::parseFile(const std::string &filePath)
return NULL;
}
std::string const Parser::renderHTML(cmark_node *node)
/*std::string const Parser::renderHTML(cmark_node *node)
{
char *tmp = cmark_render_html(node, options, NULL);
std::string output = std::string(tmp);
free(tmp);
return output;
}
}*/
/**
* This is a function that will make enabling extensions easier

View File

@ -13,11 +13,9 @@ class Parser
public:
Parser();
cmark_node * parseFile(const std::string &filePath);
std::string const renderHTML(cmark_node *node);
private:
int options;
void addMarkdownExtension(cmark_parser *parser, const char *extName);
};
#endif

View File

@ -1,2 +1,3 @@
missingIncludeSystem
missingInclude:lib/*
missingInclude:lib/*
unusedFunction:src/render-area.cc:203