mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5b8f0dd488
commit
761d1972c5
1 changed files with 7 additions and 1 deletions
|
|
@ -50,8 +50,14 @@ char *replace_char(char *str, char replace, char *replace_by)
|
||||||
char *quote(char *string)
|
char *quote(char *string)
|
||||||
{
|
{
|
||||||
char *new_line_removed = replace_char(string, '\n', "<br>");
|
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(new_line_removed);
|
||||||
|
free(less_than_removed);
|
||||||
|
free(greater_than_removed);
|
||||||
|
free(double_quotes_removed);
|
||||||
return single_quotes_removed;
|
return single_quotes_removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue