From 711eaeac7f8d22b4a37b38eac9a9ffe02403633a Mon Sep 17 00:00:00 2001 From: soraefir Date: Thu, 24 Aug 2023 10:26:37 +0200 Subject: [PATCH] Fixing GPX parse error --- router/api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/router/api.js b/router/api.js index 5b73b42..fba8eec 100644 --- a/router/api.js +++ b/router/api.js @@ -51,12 +51,12 @@ module.exports = (fastify, opts, done) => { const data = JSON.parse(val); const gen_wpt = (name,desc,latlon,icon="Flag") => `0${name}-${desc}${icon}` data.main.forEach(a => { - file+= gen_wpt(a.hotel.name, a.hotel.notes.replace("\n","... "), a.hotel.latlon, icon="Hotel"); + file+= gen_wpt(a.hotel.name, a.hotel.notes.replace("\n","... ").replace("&","\&"), a.hotel.latlon, icon="Hotel"); a.places.restaurants.forEach(b => { - file+= gen_wpt(b.name, b.notes.replace("\n","... "), b.latlon, icon="Restaurant"); + file+= gen_wpt(b.name, b.notes.replace("\n","... ").replace("&","\&"), b.latlon, icon="Restaurant"); }); a.places.activities.forEach(b => { - file+= gen_wpt(b.name, b.notes.replace("\n","... "), b.latlon, icon="Tree"); + file+= gen_wpt(b.name, b.notes.replace("\n","... ").replace("&","\&"), b.latlon, icon="Tree"); }); }); file+="";