From f46b6f6ee2b2cd4a9853391d0d28104ea377f6ce Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sat, 19 Jul 2014 01:49:30 +0200 Subject: [PATCH] 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 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- save-html.c | 6 ++++-- 1 file 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)