summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorverdant <i@glowisle.me>2026-05-24 20:25:25 +0800
committerverdant <i@glowisle.me>2026-05-24 20:25:25 +0800
commit1cacbef80f06b092a6114658be01daa0dba1bd46 (patch)
treedfba9f5b61c81b018812f5ff60f9b545a7743412
parentf1c998ee2b201d7aa2ea3ff801cf1a03b4aa02fb (diff)
downloadvmp-1cacbef80f06b092a6114658be01daa0dba1bd46.tar.gz
vmp-1cacbef80f06b092a6114658be01daa0dba1bd46.zip
chore: remove markdown parser
-rw-r--r--parser.c47
-rw-r--r--parser.h30
2 files changed, 0 insertions, 77 deletions
diff --git a/parser.c b/parser.c
deleted file mode 100644
index abb8ca6..0000000
--- a/parser.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdio.h>
-#include "parser.h"
-
-
-/* Return the level of title */
-int parse_title(struct md_token* mt){
-
- int level = 0;
- if (mt->idx >= mt->line_len) {
- return -1;
- }
-
- if (mt->line[mt->idx] == '\0' || mt->line[mt->idx] == '\n') {
- return -1;
- }
-
- while(mt->idx < mt->line_len && mt->line[mt->idx] == '#') {
- level++;
- mt->idx++;
- }
-
- mt->start_pos = mt->idx + 1;
- char tmp[1024] = "";
- size_t mt_idx = mt->start_pos;
- int idx = 0;
- while (mt_idx < mt->line_len && mt->line[mt_idx] != '\0' && mt->line[mt_idx] != '\n') {
- tmp[idx] = mt->line[mt_idx];
- mt_idx++;
- idx++;
- }
- printf("<h%d>%s</h%d>", level, tmp, level);
- return level;
-}
-
-
-int parse_content(struct md_token* mt) {
- if (mt->idx >= mt->line_len) {
- return -1;
- }
-
- if (mt->line[mt->idx] == '\0' || mt->line[mt->idx] == '\n') {
- return -1;
- }
-
- printf("<p>%s</p>",mt->line);
- return 0;
-}
diff --git a/parser.h b/parser.h
deleted file mode 100644
index e771a9c..0000000
--- a/parser.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef VMP_PARSER_H
-#define VMP_PARSER_H
-
-#include "stack.h"
-
-typedef enum {
- NODE_BOLD,
- NODE_ITALIC,
- NODE_LIST,
- NODE_CODEBLK,
-} md_node_type;
-
-
-struct md_token {
- size_t idx;
- size_t line_len;
- int start_pos;
- char* line;
- md_node_type type;
-};
-
-
-int parse_title(struct md_token* mt);
-int parse_bold(const char* line);
-int parse_ul(const char* line);
-int parse_ol(const char* line);
-int parse_content(struct md_token* mt);
-
-
-#endif