[geany/geany] 527dee: Export: fix LaTeX export for more than 2 consecutive '-', '<' or '>'
Colomban Wendling
git-noreply at xxxxx
Wed Apr 9 16:07:48 UTC 2014
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Wed, 09 Apr 2014 16:07:48 UTC
Commit: 527dee720362a20063b730cbcad97f184c636f17
https://github.com/geany/geany/commit/527dee720362a20063b730cbcad97f184c636f17
Log Message:
-----------
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.
Modified Paths:
--------------
plugins/export.c
Modified: plugins/export.c
40 files changed, 7 insertions(+), 33 deletions(-)
===================================================================
@@ -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;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list