LibreWeb-Browser/src/md-parser.h

29 lines
597 B
C
Raw Normal View History

2020-11-16 10:31:58 -08:00
#ifndef MD_PARSER_H
#define MD_PARSER_H
2020-11-12 16:54:34 -08:00
#include <string>
2020-11-12 16:54:34 -08:00
#include <cmark-gfm.h>
2020-11-14 17:39:05 -08:00
#include <render.h>
#include <sstream>
/**
* \class Parser Markdown parser class, parse the content to an AST model
*/
2020-11-16 10:31:58 -08:00
class Parser
2020-11-12 16:54:34 -08:00
{
public:
2020-12-14 10:40:08 -08:00
// Singleton
static Parser& getInstance();
static cmark_node * parseContent(const std::string &content);
static std::string const renderHTML(cmark_node *node);
2020-11-15 16:10:54 -08:00
2020-11-12 16:54:34 -08:00
private:
2020-12-14 10:40:08 -08:00
Parser();
~Parser();
Parser(const Parser&)= delete;
Parser& operator=(const Parser&)= delete;
static void addMarkdownExtension(cmark_parser *parser, const char *extName);
2020-11-12 16:54:34 -08:00
};
2020-11-16 10:31:58 -08:00
#endif