Export: fix LaTeX export for more than 2 consecutive '-', '<' or '>'
Fix escaping of '-', '<' and '>' characters to properly handle inputs with more than 2 consecutive identical characters of this set.
This commit is contained in:
parent
874c822328
commit
527dee7203
@ -492,40 +492,14 @@ static void write_latex_file(GeanyDocument *doc, const gchar *filename,
|
||||
g_string_append(body, "\\symbol{94}");
|
||||
break;
|
||||
}
|
||||
/** TODO still don't work for "---" or "----" */
|
||||
case '-': /* mask "--" */
|
||||
/* mask "--", "<<" and ">>" */
|
||||
case '-':
|
||||
case '<':
|
||||
case '>':
|
||||
{
|
||||
if (c_next == '-')
|
||||
{
|
||||
g_string_append(body, "-\\/-");
|
||||
i++; /* skip the next character */
|
||||
}
|
||||
else
|
||||
g_string_append_c(body, '-');
|
||||
|
||||
break;
|
||||
}
|
||||
case '<': /* mask "<<" */
|
||||
{
|
||||
if (c_next == '<')
|
||||
{
|
||||
g_string_append(body, "<\\/<");
|
||||
i++; /* skip the next character */
|
||||
}
|
||||
else
|
||||
g_string_append_c(body, '<');
|
||||
|
||||
break;
|
||||
}
|
||||
case '>': /* mask ">>" */
|
||||
{
|
||||
if (c_next == '>')
|
||||
{
|
||||
g_string_append(body, ">\\/>");
|
||||
i++; /* skip the next character */
|
||||
}
|
||||
else
|
||||
g_string_append_c(body, '>');
|
||||
g_string_append_c(body, c);
|
||||
if (c_next == c)
|
||||
g_string_append(body, "\\/");
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user