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:
parent
6dc8e4f66f
commit
be18f431c7
1 changed files with 10 additions and 1 deletions
|
@ -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, "<");
|
||||
if (end_token) g_string_append(pango, "/");
|
||||
while (p_markup < p)
|
||||
|
|
Loading…
Reference in a new issue