Added H1 and H2 to md_pango

This commit is contained in:
Markus Koch 2017-03-15 17:36:30 +01:00
parent b0b6a553b7
commit 48a8f9b691

View File

@ -25,6 +25,16 @@ gchar *md_pango_render(gchar *markup, gint length)
g_regex_unref(regex); g_regex_unref(regex);
g_free(str); g_free(str);
regex = g_regex_new("#{2}(.*)", 0, 0, NULL);
str = g_regex_replace(regex, str2, -1, 0, "<h1>\\1</h1>", 0, NULL);
g_regex_unref(regex);
g_free(str2);
regex = g_regex_new("#{1}(.*)", 0, 0, NULL);
str2 = g_regex_replace(regex, str, -1, 0, "<h2>\\1</h2>", 0, NULL);
g_regex_unref(regex);
g_free(str);
regex = g_regex_new("\\!\\[([^\\]]*)\\]\\(([^\\)]*)\\)", 0, 0, NULL); regex = g_regex_new("\\!\\[([^\\]]*)\\]\\(([^\\)]*)\\)", 0, 0, NULL);
str = g_regex_replace(regex, str2, -1, 0, "-- Image \\1 (\\2) --", 0, NULL); str = g_regex_replace(regex, str2, -1, 0, "-- Image \\1 (\\2) --", 0, NULL);
g_regex_unref(regex); g_regex_unref(regex);