pango_md: Remove linebreaks within a paragraph
This commit is contained in:
parent
a6a3967940
commit
8cee5b5188
@ -26,6 +26,18 @@ gchar *md_pango_render(gchar *markup, gint length)
|
||||
g_free(str);
|
||||
str = str2;
|
||||
|
||||
regex = g_regex_new("(.+)\n", 0, 0, NULL);
|
||||
str2 = g_regex_replace(regex, str, -1, 0, "\\1 ", 0, NULL);
|
||||
g_regex_unref(regex);
|
||||
g_free(str);
|
||||
str = str2;
|
||||
|
||||
regex = g_regex_new("\n", 0, 0, NULL);
|
||||
str2 = g_regex_replace(regex, str, -1, 0, "\n\n", 0, NULL);
|
||||
g_regex_unref(regex);
|
||||
g_free(str);
|
||||
str = str2;
|
||||
|
||||
regex = g_regex_new("\\*{2}([^\\*\n]*)\\*{2}", 0, 0, NULL);
|
||||
str2 = g_regex_replace(regex, str, -1, 0, "<b>\\1</b>", 0, NULL);
|
||||
g_regex_unref(regex);
|
||||
|
Loading…
Reference in New Issue
Block a user