removes comments when parsing GPX

This commit is contained in:
Christian Beutel
2025-04-08 19:44:59 +02:00
parent 624d99a2b5
commit 8b3a923743

View File

@@ -171,7 +171,7 @@ export default class GPX {
}
static parse(gpxString: string): Promise<GPX | Error> {
const sanitizedGPX = gpxString.replace(/\sxmlns=""/g, '');
const sanitizedGPX = gpxString.replace(/\sxmlns=""/g, '').replace(/<!--[\s\S]*?-->/g, '');
return new Promise<GPX | Error>((resolve, reject) => xml2js.parseString(sanitizedGPX, {
explicitArray: false,