From f3b392e06a72cc1461ab2c9587c96991a2731e9c Mon Sep 17 00:00:00 2001 From: default Date: Thu, 18 Jul 2024 17:19:14 +0200 Subject: [PATCH] Show bold+italic (text between ***) correctly. --- format.c | 12 +++++++++--- html.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/format.c b/format.c index c30fd5d..52edd05 100644 --- a/format.c +++ b/format.c @@ -88,9 +88,9 @@ static xs_str *format_line(const char *line, xs_list **attach) /* split by markup */ xs *sm = xs_regex_split(line, "(" - "`[^`]+`" "|" - "\\*\\*?[^\\*]+\\*?\\*" "|" - "\\[[^]]+\\]\\([^\\)]+\\)" "|" + "`[^`]+`" "|" + "\\*\\*?\\*?[^\\*]+\\*?\\*?\\*" "|" + "\\[[^]]+\\]\\([^\\)]+\\)" "|" "https?:/" "/[^[:space:]]+" ")"); int n = 0; @@ -106,6 +106,12 @@ static xs_str *format_line(const char *line, xs_list **attach) s = xs_str_cat(s, s2); } else + if (xs_startswith(v, "***")) { + xs *s1 = xs_crop_i(xs_dup(v), 3, -3); + xs *s2 = xs_fmt("%s", s1); + s = xs_str_cat(s, s2); + } + else if (xs_startswith(v, "**")) { xs *s1 = xs_crop_i(xs_dup(v), 2, -2); xs *s2 = xs_fmt("%s", s1); diff --git a/html.c b/html.c index a80c1d1..642d63a 100644 --- a/html.c +++ b/html.c @@ -2090,7 +2090,7 @@ xs_html *html_footer(void) xs_html_tag("a", xs_html_attr("href", WHAT_IS_SNAC_URL), xs_html_tag("abbr", - xs_html_attr("title", "Social Network Are Crap"), + xs_html_attr("title", "Social Networks Are Crap"), xs_html_text("snac")))); }