Skip to content

Instantly share code, notes, and snippets.

@bjonnh
Last active November 10, 2020 17:32
Show Gist options
  • Save bjonnh/c5446b3e81490535c629bf59897de615 to your computer and use it in GitHub Desktop.
Save bjonnh/c5446b3e81490535c629bf59897de615 to your computer and use it in GitHub Desktop.
Decode outlook protection urls in elisp
(defun decode-url-at-point (&optional arg)
"Decode the outlook protection encoded url, display it as a message and put in the kill-ring."
(interactive "P")
(let ((url (browse-url-url-at-point)))
(if url
(let ((decodedurl (url-unhex-string (nth 1 (split-string (nth 0 (split-string url "&")) "=")))))
(message "%s" decodedurl)
(kill-new decodedurl))
(error "No URL found"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment