From 7f5ecacd12e7908a3f1575b53920c10dac2e9a56 Mon Sep 17 00:00:00 2001 From: verdant Date: Sun, 31 May 2026 11:38:49 +0800 Subject: Remove cmark, refactor all Implement head and split line parser --- main.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 main.c (limited to 'main.c') 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 -#include -#include -#include - -#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; -} -- cgit v1.2.3