From 7ee1ad61627f9a2af04f080cfa95a30f3c8e4525 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 31 Oct 2024 11:27:20 +0800 Subject: feat: add menu-item for Geocoding * Use nominatim for API calls * Create multiple GeoLinks for each results in response * Also add menu-item DELETE to remove duplicated GeoLinks from one Geocoding --- src/utils.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils.mjs') diff --git a/src/utils.mjs b/src/utils.mjs index d2c5d8f..c0da23a 100644 --- a/src/utils.mjs +++ b/src/utils.mjs @@ -173,7 +173,7 @@ export const replaceTextNodes = ( const nodeIterator = document.createNodeIterator( rootNode, window.NodeFilter.SHOW_TEXT, - node => node.textContent.match(pattern) && !node.parentElement.closest('pre,code,a') + node => node.textContent.match(pattern) && node.parentElement && !node.parentElement.closest('pre,code,a') ? window.NodeFilter.FILTER_ACCEPT : window.NodeFilter.FILTER_REJECT, ) -- cgit v1.2.3-70-g09d2