summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-05-31 11:38:49 +0800
committerverdant <im@verdant.ee>2026-05-31 11:38:49 +0800
commit7f5ecacd12e7908a3f1575b53920c10dac2e9a56 (patch)
tree71fd2bd6bade95d27c73ee0a2668fc3e1a661798 /main.c
parent694a0a85e1abba046787e238c921897ef6b7f0fa (diff)
downloadvmp-7f5ecacd12e7908a3f1575b53920c10dac2e9a56.tar.gz
vmp-7f5ecacd12e7908a3f1575b53920c10dac2e9a56.zip
Remove cmark, refactor allHEADmaster
Implement head and split line parser
Diffstat (limited to 'main.c')
-rw-r--r--main.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/main.c b/main.c
deleted file mode 100644
index deeff4a..0000000
--- a/main.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <cmark.h>
-#include <string.h>
-
-#define MAX_SIZE 1024
-#define BUFFER_SIZE 4096
-
-/* TODO: Add custom syntax filter */
-int apply_custom_syntax(char *input);
-
-int main()
-{
- size_t cap = BUFFER_SIZE;
- size_t len = 0;
- char *markdown_input = malloc(cap);
-
- char buffer[BUFFER_SIZE];
- while (fgets(buffer, sizeof(buffer), stdin) != NULL) {
- size_t line_len = strlen(buffer);
- if (len + line_len >= cap) {
- cap *= 2;
- markdown_input = realloc(markdown_input, cap);
- }
- strcpy(markdown_input + len, buffer);
- len += line_len;
- }
- char *html_output =
- cmark_markdown_to_html(markdown_input, len, CMARK_OPT_DEFAULT);
-
- if (html_output) {
- printf("%s", html_output);
- free(html_output);
- }
-
- free(markdown_input);
- return 0;
-}