diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2014-05-30 02:13:44 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 20:57:34 -0700 |
commit | 9f12e7086d9d71bed7863ba0e3e63ed36831197a (patch) | |
tree | 044454d51561b144a79f367dbb21d16b5f9dba9b /save-html.c | |
parent | f9166e3c0e0a9479cf0fb9841a57fe92ac0a5716 (diff) | |
download | subsurface-9f12e7086d9d71bed7863ba0e3e63ed36831197a.tar.gz |
HTML: Quote the '<' and '>' operators before inserting break tags
The smaller than and greater than operators should be quoted before
inserting the <br> tags in HTML. Otherwise breaks will be quoted which
corrupts the format.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-html.c')
-rw-r--r-- | save-html.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/save-html.c b/save-html.c index 45bec2a96..609ab9e84 100644 --- a/save-html.c +++ b/save-html.c @@ -49,10 +49,10 @@ char *replace_char(char *str, char replace, char *replace_by) char *quote(char *string) { - char *new_line_removed = replace_char(string, '\n', "<br>"); - char *less_than_removed = replace_char(new_line_removed, '<', "<"); + char *less_than_removed = replace_char(string, '<', "<"); char *greater_than_removed = replace_char(less_than_removed, '>', ">"); - char *double_quotes_removed = replace_char(greater_than_removed, '"', """); + char *new_line_removed = replace_char(greater_than_removed, '\n', "<br>"); + char *double_quotes_removed = replace_char(new_line_removed, '"', """); char *single_quotes_removed = replace_char(double_quotes_removed, '\'', "'"); free(new_line_removed); free(less_than_removed); |