Fixing GPX parse error
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir 2023-08-24 10:34:04 +02:00
parent b9c17a9e9c
commit 31382f1229
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -51,10 +51,6 @@ module.exports = (fastify, opts, done) => {
const data = JSON.parse(val);
const gen_wpt = (name,desc,latlon,icon="Flag") => `<wpt lat="${latlon[0]}" lon="${latlon[1]}"><ele>0</ele><name>${name}</name><cmt>-</cmt><desc>${desc}</desc><sym>${icon}</sym></wpt>`
const esc_str = (str) => str.replace('"',"&quot;").replace("'","&apos;").replace("<","&lt;").replace(">","&gt;").replace("&","&amp;").repace("\n","...")
'
< &lt;
> &gt;
& &amp;
data.main.forEach(a => {
file+= gen_wpt(esc_str(a.hotel.name), esc_str(a.hotel.notes), a.hotel.latlon, icon="Hotel");
a.places.restaurants.forEach(b => {