aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-31 11:27:20 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-31 12:01:51 +0800
commit7ee1ad61627f9a2af04f080cfa95a30f3c8e4525 (patch)
treecff733c310788f802fe00fbcdd8f4054a3ef4075 /src/utils.mjs
parent2bcad7ff9a42ad39a4b2f24c4af9b6a5578ba1fd (diff)
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
Diffstat (limited to 'src/utils.mjs')
-rw-r--r--src/utils.mjs2
1 files changed, 1 insertions, 1 deletions
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 = (
173 const nodeIterator = document.createNodeIterator( 173 const nodeIterator = document.createNodeIterator(
174 rootNode, 174 rootNode,
175 window.NodeFilter.SHOW_TEXT, 175 window.NodeFilter.SHOW_TEXT,
176 node => node.textContent.match(pattern) && !node.parentElement.closest('pre,code,a') 176 node => node.textContent.match(pattern) && node.parentElement && !node.parentElement.closest('pre,code,a')
177 ? window.NodeFilter.FILTER_ACCEPT 177 ? window.NodeFilter.FILTER_ACCEPT
178 : window.NodeFilter.FILTER_REJECT, 178 : window.NodeFilter.FILTER_REJECT,
179 ) 179 )