From bb0d8f2a2755af5e11b46d32be84155ba71ea534 Mon Sep 17 00:00:00 2001
From: default
Date: Thu, 12 Jan 2023 09:28:02 +0100
Subject: Backport from xs.
---
format.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'format.c')
diff --git a/format.c b/format.c
index 7ded83c..58b6c7d 100644
--- a/format.c
+++ b/format.c
@@ -53,19 +53,19 @@ static d_char *format_line(const char *line)
if ((n & 0x1)) {
/* markup */
if (xs_startswith(v, "`")) {
- xs *s1 = xs_crop(xs_dup(v), 1, -1);
+ xs *s1 = xs_crop_i(xs_dup(v), 1, -1);
xs *s2 = xs_fmt("%s", s1);
s = xs_str_cat(s, s2);
}
else
if (xs_startswith(v, "**")) {
- xs *s1 = xs_crop(xs_dup(v), 2, -2);
+ xs *s1 = xs_crop_i(xs_dup(v), 2, -2);
xs *s2 = xs_fmt("%s", s1);
s = xs_str_cat(s, s2);
}
else
if (xs_startswith(v, "*")) {
- xs *s1 = xs_crop(xs_dup(v), 1, -1);
+ xs *s1 = xs_crop_i(xs_dup(v), 1, -1);
xs *s2 = xs_fmt("%s", s1);
s = xs_str_cat(s, s2);
}
@@ -117,11 +117,11 @@ d_char *not_really_markdown(const char *content)
if (in_pre)
ss = xs_dup(v);
else
- ss = xs_strip(format_line(v));
+ ss = xs_strip_i(format_line(v));
if (xs_startswith(ss, ">")) {
/* delete the > and subsequent spaces */
- ss = xs_strip(xs_crop(ss, 1, 0));
+ ss = xs_strip_i(xs_crop_i(ss, 1, 0));
if (!in_blq) {
s = xs_str_cat(s, "
"); @@ -184,9 +184,9 @@ d_char *sanitize(const char *content) while (xs_list_iter(&p, &v)) { if (n & 0x1) { - xs *s1 = xs_strip(xs_crop(xs_dup(v), v[1] == '/' ? 2 : 1, -1)); + xs *s1 = xs_strip_i(xs_crop_i(xs_dup(v), v[1] == '/' ? 2 : 1, -1)); xs *l1 = xs_split_n(s1, " ", 1); - xs *tag = xs_tolower(xs_dup(xs_list_get(l1, 0))); + xs *tag = xs_tolower_i(xs_dup(xs_list_get(l1, 0))); xs *s2 = NULL; int i; -- cgit v1.2.3