From 9b1f25f3f4ffbfd48a5aa8b18e20e73e5ed3dbe3 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Wed, 30 Mar 2022 00:20:49 +0800 Subject: [PATCH] fix: relative url with gdanchor parameter --- resources/gd-custom.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/gd-custom.js b/resources/gd-custom.js index bba57312..ae5bba3b 100644 --- a/resources/gd-custom.js +++ b/resources/gd-custom.js @@ -27,12 +27,17 @@ $(function() { } } else { index = href.indexOf("?"); - if(index>-1) - { - newLink = href.substring(0, index) + "?word=" + link; + + if (link.indexOf("?gdanchor") > -1) { + newLink = "gdlookup://localhost/" + link; } - else{ - newLink=href+"?word=" + link; + else { + if (index > -1) { + newLink = href.substring(0, index) + "?word=" + link; + } + else { + newLink = href + "?word=" + link; + } } } $(this).attr("href", newLink);