HTML: Better quoting to the export strings

Move the quote function to membuffer.c and adding wrappers that call
it from both xml and html exporters to get rid of redundancy.

Quote the location, buddy, suit, tags and notes This
prevents js code from crashing.

[Miika Turkia: minor whitespace and code fix]

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Gehad elrobey 2014-06-02 20:10:54 +03:00 committed by Dirk Hohndel
parent 1120379b2b
commit 464a611d8d
6 changed files with 73 additions and 104 deletions

View file

@ -13,9 +13,7 @@ void put_HTML_airtemp(struct membuffer *b, struct dive *dive, const char *pre, c
void put_HTML_watertemp(struct membuffer *b, struct dive *dive, const char *pre, const char *post);
void put_HTML_time(struct membuffer *b, struct dive *dive, const char *pre, const char *post);
void put_HTML_notes(struct membuffer *b, struct dive *dive, const char *pre, const char *post);
char *replace_char(char *str, char replace, char *replace_by);
char *quote(char *string);
void put_HTML_quoted(struct membuffer *b, const char *text);
void export_HTML(const char *file_name, const bool selected_only);