Fix description of objects in GPX export (fixes #50)

- Values were missing from description
- If there is only the default field (Description), it is not prefixed
by "Description: "
pull/108/head
Candid Dauth 2017-02-10 12:55:04 +01:00
rodzic 95c226305b
commit 14900f3c72
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -3,9 +3,12 @@ var utils = require("./utils");
var _e = utils.escapeXml;
function _dataToText(fields, data) {
if(fields.length == 1 && fields[0].name == "Description")
return data["Description"] || "";
var text = [ ];
for(var i=0; i<fields.length; i++) {
text.push(fields[i].name + ": " + (data[fields[i]] || ""));
text.push(fields[i].name + ": " + (data[fields[i].name] || ""));
}
return text.join('\n\n');
}