From e661047eb6fb6cb302b109588c085ee71a750db7 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 6 Dec 2024 23:03:23 -0800 Subject: [PATCH] Allow leading and trailing whitespace in safe address Useful when copying addresses from documents, which sometimes adds a trailing space. --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 70cfe9a..3d74fdc 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,7 @@
- + @@ -264,7 +264,7 @@ const { safe, rpc } = Object.fromEntries(new FormData(e.target)); tree.innerHTML = ''; allAddresses.length = 0; - await insertTreeNode(tree, safe.replace(/^.+:/, '').toLowerCase(), rpc); + await insertTreeNode(tree, safe.replace(/^.+:/, '').trim().toLowerCase(), rpc); document.querySelectorAll('svg').forEach(svg => { svg.addEventListener('mouseover', e => highlightAddress(tree, svg.closest('li').textContent.substring(0, 42))); svg.addEventListener('mouseout', e => CSS.highlights.clear()); -- 2.47.3