diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-05-29 08:30:05 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 07:27:39 -0700 |
commit | 761d1972c5e60c5eabcaa5ec61d3458008426375 (patch) | |
tree | d3c49084746f48b1ce452e653a8f9f6960c0c0ed /save-html.c | |
parent | 5b8f0dd4885b67dc11c3ff185a055c6f32caaf6d (diff) | |
download | subsurface-761d1972c5e60c5eabcaa5ec61d3458008426375.tar.gz |
Need to quote some more HTML characters
Double quote will break HTML export when it is e.g. within notes.
Similarly < and > characters are treated as HTML tags unless quoted
properly.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-html.c')
-rw-r--r-- | save-html.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/save-html.c b/save-html.c index 7b86ab051..386ce9359 100644 --- a/save-html.c +++ b/save-html.c @@ -50,8 +50,14 @@ char *replace_char(char *str, char replace, char *replace_by) char *quote(char *string) { char *new_line_removed = replace_char(string, '\n', "<br>"); - char *single_quotes_removed = replace_char(new_line_removed, '\'', "'"); + char *less_than_removed = replace_char(new_line_removed, '<', "<"); + char *greater_than_removed = replace_char(less_than_removed, '>', ">"); + char *double_quotes_removed = replace_char(greater_than_removed, '"', """); + char *single_quotes_removed = replace_char(double_quotes_removed, '\'', "'"); free(new_line_removed); + free(less_than_removed); + free(greater_than_removed); + free(double_quotes_removed); return single_quotes_removed; } |