From ff984f72c904d8c4c1acbc894ac04a7f1546a80b Mon Sep 17 00:00:00 2001 From: marc tobias Date: Tue, 29 Aug 2023 22:48:12 +0200 Subject: [PATCH] Details page: Allow searching for negative OSM ids --- src/components/SearchSectionDetails.svelte | 6 +++--- src/lib/helpers.js | 2 +- test/unit/helpers.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/SearchSectionDetails.svelte b/src/components/SearchSectionDetails.svelte index f23a24c..5ca614a 100644 --- a/src/components/SearchSectionDetails.svelte +++ b/src/components/SearchSectionDetails.svelte @@ -6,8 +6,8 @@ function handleFormSubmit(event) { let form_el = event.target; let val = form_el.querySelector('input[type=edit]').value.trim(); - let type_and_id_match = val.match(/^\s*([NWR])(\d+)\s*$/i) - || val.match(/\/(relation|way|node)\/(\d+)\s*$/); + let type_and_id_match = val.match(/^\s*([NWR])(-?\d+)\s*$/i) + || val.match(/\/(relation|way|node)\/(-?\d+)\s*$/); var params = new URLSearchParams(); if (type_and_id_match) { @@ -30,7 +30,7 @@