summaryrefslogtreecommitdiff
path: root/st-urlhandler
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-03-03 21:39:35 -0500
committerLuke Smith <luke@lukesmith.xyz>2021-03-03 21:39:35 -0500
commit67ef1c4d4ec3d3a423a078eb746fa2fac4a267e9 (patch)
treef2622ea4d2ddcb003c2c7c9c55a8d541c8f67135 /st-urlhandler
parentebb7b6c96ab4fbd415df815faf1f3974df985dd5 (diff)
remove final punctuation from possible urls
Diffstat (limited to 'st-urlhandler')
-rwxr-xr-xst-urlhandler3
1 files changed, 2 insertions, 1 deletions
diff --git a/st-urlhandler b/st-urlhandler
index b8f9787..e2a62f4 100755
--- a/st-urlhandler
+++ b/st-urlhandler
@@ -5,7 +5,8 @@ urlregex="(((http|https|gopher|gemini|ftp|ftps|git)://|www\\.)[a-zA-Z0-9.]*[:]?[
urls="$(sed 's/.*│//g' | tr -d '\n' | # First remove linebreaks and mutt sidebars:
grep -aEo "$urlregex" | # grep only urls as defined above.
uniq | # Ignore neighboring duplicates.
- sed 's/^www./http:\/\/www\./g')" # xdg-open will not detect url without http://
+ sed "s/\(\.\|,\|;\|\!\\|\?\)$//;
+ s/^www./http:\/\/www\./")" # xdg-open will not detect url without http
[ -z "$urls" ] && exit 1