From c6c5150b598a68bc60d084a9db9447cb9b0137e1 Mon Sep 17 00:00:00 2001 From: grunfink Date: Wed, 27 Aug 2025 09:54:33 +0200 Subject: Added Markdown support for bullets (unsorted lists). --- format.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'format.c') diff --git a/format.c b/format.c index 7b18909..e3f20c2 100644 --- a/format.c +++ b/format.c @@ -278,6 +278,7 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag xs_str *s = xs_str_new(NULL); int in_pre = 0; int in_blq = 0; + int in_ul = 0; xs *list; char *p; const char *v; @@ -361,11 +362,30 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag continue; } + if (xs_startswith(ss, "* ") || xs_startswith(ss, "- ")) { + /* unsorted list */ + ss = xs_strip_i(xs_crop_i(ss, 1, 0)); + + if (!in_ul) { + s = xs_str_cat(s, "
", ""); s = xs_replace_i(s, ""); s = xs_replace_i(s, "
", "