mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Dive_sites-Notes shouldn't be stored as attribute
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 <salvador.cunat@gmail.com> ACKed-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bdaa4eb8b0
commit
b26e516e2a
1 changed files with 4 additions and 6 deletions
10
save-xml.c
10
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, " <notes>", " </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, "<geo cat='%d'", t->category);
|
||||
put_format(b, " <geo cat='%d'", t->category);
|
||||
put_format(b, " origin='%d'", t->origin);
|
||||
show_utf8(b, t->value, " value='", "'/>\n", 1);
|
||||
}
|
||||
}
|
||||
put_format(b, "</site>\n");
|
||||
} else {
|
||||
put_format(b, "/>\n");
|
||||
}
|
||||
put_format(b, "</site>\n");
|
||||
}
|
||||
put_format(b, "</divesites>\n<dives>\n");
|
||||
for (trip = dive_trip_list; trip != NULL; trip = trip->next)
|
||||
|
|
Loading…
Reference in a new issue