FIX: #791 Added markers block exporting markers

This commit is contained in:
Mészáros Gergely 2022-05-07 10:13:42 +02:00
parent d12e22aa5c
commit 67f8c68983

View file

@ -171,13 +171,15 @@ function overviewMarkers() {
function exportMarkers() {
const headers = "Id,Type,Icon,Name,Note,X,Y\n";
const quote = s => '"' + s.replace('"', "'") + '"';
const body = pack.markers.map(marker => {
const {i, type, icon, x, y} = marker;
const id = `marker${i}`;
const note = notes.find(note => note.id === id);
const legend = escape(note.legend);
return [id, type, icon, note.name, legend, x, y].join(",");
const name = note ? quote(note.name) : 'Unknown';
const legend = note ? quote(note.legend) : '';
return [id, type, icon, name, legend, x, y].join(",");
});
const data = headers + body.join("\n");