diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2014-07-19 01:49:30 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-25 07:14:30 -0700 |
commit | f46b6f6ee2b2cd4a9853391d0d28104ea377f6ce (patch) | |
tree | 112c94af334b025c07522609884a6b4e2bea848c /save-html.c | |
parent | 7fabeda18482ad7069cfe5c9794454ab478f395c (diff) | |
download | subsurface-f46b6f6ee2b2cd4a9853391d0d28104ea377f6ce.tar.gz |
HTML: Add notes variable to the JSON file even if notes don't exist
if dive notes don't exist, notes variable must be added to the
javascript containing empty value "--", this is more friendly than just
showing 'undefined'
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>
Diffstat (limited to 'save-html.c')
-rw-r--r-- | save-html.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/save-html.c b/save-html.c index f6b9a50e0..710569dee 100644 --- a/save-html.c +++ b/save-html.c @@ -114,11 +114,13 @@ void put_HTML_quoted(struct membuffer *b, const char *text) void put_HTML_notes(struct membuffer *b, struct dive *dive, const char *pre, const char *post) { + put_string(b, pre); if (dive->notes) { - put_string(b, pre); put_HTML_quoted(b, dive->notes); - put_string(b, post); + } else { + put_string(b, "--"); } + put_string(b, post); } void put_HTML_time(struct membuffer *b, struct dive *dive, const char *pre, const char *post) |