mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Show bold+italic (text between ***) correctly.
This commit is contained in:
parent
cd96728593
commit
f3b392e06a
2 changed files with 10 additions and 4 deletions
8
format.c
8
format.c
|
@ -89,7 +89,7 @@ static xs_str *format_line(const char *line, xs_list **attach)
|
||||||
xs *sm = xs_regex_split(line,
|
xs *sm = xs_regex_split(line,
|
||||||
"("
|
"("
|
||||||
"`[^`]+`" "|"
|
"`[^`]+`" "|"
|
||||||
"\\*\\*?[^\\*]+\\*?\\*" "|"
|
"\\*\\*?\\*?[^\\*]+\\*?\\*?\\*" "|"
|
||||||
"\\[[^]]+\\]\\([^\\)]+\\)" "|"
|
"\\[[^]]+\\]\\([^\\)]+\\)" "|"
|
||||||
"https?:/" "/[^[:space:]]+"
|
"https?:/" "/[^[:space:]]+"
|
||||||
")");
|
")");
|
||||||
|
@ -106,6 +106,12 @@ static xs_str *format_line(const char *line, xs_list **attach)
|
||||||
s = xs_str_cat(s, s2);
|
s = xs_str_cat(s, s2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (xs_startswith(v, "***")) {
|
||||||
|
xs *s1 = xs_crop_i(xs_dup(v), 3, -3);
|
||||||
|
xs *s2 = xs_fmt("<b><i>%s</i></b>", s1);
|
||||||
|
s = xs_str_cat(s, s2);
|
||||||
|
}
|
||||||
|
else
|
||||||
if (xs_startswith(v, "**")) {
|
if (xs_startswith(v, "**")) {
|
||||||
xs *s1 = xs_crop_i(xs_dup(v), 2, -2);
|
xs *s1 = xs_crop_i(xs_dup(v), 2, -2);
|
||||||
xs *s2 = xs_fmt("<b>%s</b>", s1);
|
xs *s2 = xs_fmt("<b>%s</b>", s1);
|
||||||
|
|
2
html.c
2
html.c
|
@ -2090,7 +2090,7 @@ xs_html *html_footer(void)
|
||||||
xs_html_tag("a",
|
xs_html_tag("a",
|
||||||
xs_html_attr("href", WHAT_IS_SNAC_URL),
|
xs_html_attr("href", WHAT_IS_SNAC_URL),
|
||||||
xs_html_tag("abbr",
|
xs_html_tag("abbr",
|
||||||
xs_html_attr("title", "Social Network Are Crap"),
|
xs_html_attr("title", "Social Networks Are Crap"),
|
||||||
xs_html_text("snac"))));
|
xs_html_text("snac"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue