Fixes in rich text to pango markup conversion.

[GB.GTK]
* NEW: Replace '<code>' by '<tt>' in rich text.
* BUG: '<p>' in rich text is replaced by a single line break.

[GB.GTK3]
* NEW: Replace '<code>' by '<tt>' in rich text.
* BUG: '<p>' in rich text is replaced by a single line break.
This commit is contained in:
gambas 2020-12-18 02:57:12 +01:00
parent 6dc8e4f66f
commit be18f431c7

View file

@ -1053,7 +1053,7 @@ char *gt_html_to_pango_string(const char *html, int len_html, bool newline_are_b
{
if ((end_token || inside_par) && p[1])
{
g_string_append(pango, "\n\n");
g_string_append(pango, "\n");
newline = true;
}
inside_par = start_token;
@ -1135,6 +1135,15 @@ char *gt_html_to_pango_string(const char *html, int len_html, bool newline_are_b
goto __FOUND_TOKEN;
}
if (!strcasecmp(token, "code"))
{
if (start_token && !end_token)
g_string_append(pango, "<tt>");
else if (end_token && !start_token)
g_string_append(pango, "</tt>");
goto __FOUND_TOKEN;
}
g_string_append(pango, "&lt;");
if (end_token) g_string_append(pango, "/");
while (p_markup < p)