mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:23:24 +00:00
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>
This commit is contained in:
parent
f9166e3c0e
commit
9f12e7086d
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue