From b26e516e2aff961a4c7d73cbfae0d202b12d11dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20Cu=C3=B1at?= Date: Sun, 4 Oct 2015 11:17:25 +0200 Subject: [PATCH] Dive_sites-Notes shouldn't be stored as attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If so, some formatting chars (like "\n") will be dropped while parsing. This could be pretty annoying for a user who tries to keep notes other than a simple text, e.g. if the site is a wreck, may be interesting to have some data shown like: ... Max. Depth = 60 m Min. Depth = 40 m Prow: bla, bla, bla. Stern: bla, bla, bla. ... instead of a single text line. Signed-off-by: Salvador Cuñat ACKed-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- save-xml.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/save-xml.c b/save-xml.c index 6d0284056..8aa5088af 100644 --- a/save-xml.c +++ b/save-xml.c @@ -550,21 +550,19 @@ void save_dives_buffer(struct membuffer *b, const bool select_only) put_degrees(b, ds->longitude, "", "'"); } show_utf8(b, ds->description, " description='", "'", 1); - show_utf8(b, ds->notes, " notes='", "'", 1); + put_format(b, ">\n"); + show_utf8(b, ds->notes, " ", " \n", 0); if (ds->taxonomy.nr) { - put_format(b, ">\n"); for (int j = 0; j < ds->taxonomy.nr; j++) { struct taxonomy *t = &ds->taxonomy.category[j]; if (t->category != TC_NONE) { - put_format(b, "category); + put_format(b, " category); put_format(b, " origin='%d'", t->origin); show_utf8(b, t->value, " value='", "'/>\n", 1); } } - put_format(b, "\n"); - } else { - put_format(b, "/>\n"); } + put_format(b, "\n"); } put_format(b, "\n\n"); for (trip = dive_trip_list; trip != NULL; trip = trip->next)