Kaydet (Commit) 527dee72 authored tarafından Colomban Wendling's avatar Colomban Wendling

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.
üst 874c8223
......@@ -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 "--" */
{
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 ">>" */
/* mask "--", "<<" and ">>" */
case '-':
case '<':
case '>':
{
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment