diff --git a/qwan/qwan-blog.el b/qwan/qwan-blog.el index 90f9358..226e9d7 100644 --- a/qwan/qwan-blog.el +++ b/qwan/qwan-blog.el @@ -48,7 +48,19 @@ only the description" (insert content))))))) (bind-key "C-c r" 'qwan/org-replace-link-by-link-description) -(defun org-roam-replace-file-link-by-website-or-description () +(defun strip-url (url) + "Remove everything after ? from the url, to hinder tracking." + (replace-regexp-in-string "\\?.*$" "" url)) + +;; TODO define key for this maybe SPC q is available? no, that is quit. +(defun qwan/paste-stripped-url () + "Paste a URL without tracking from the clipboard into the current buffer." + (interactive) + (let ((url (x-get-selection 'CLIPBOARD))) + (when url + (insert (strip-url url))))) + +(defun qwan/org-roam-replace-file-link-by-website-or-description () "If a linked org-roam file has a website as key, use that as the link target instead of the filename. Otherwise, remove the link, and leave just the description.