Browse Source

org-protocol: Allow slashes after sub-protocol

* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Handle URIs with additional slashes before the start of the query
string, e.g. "org-protocol:/capture/?template=..." instead of
"org-protocol:/capture?template=...", as neede for some browsers.

TINYCHANGE
fpi 5 years ago
parent
commit
928e67df7e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org-protocol.el

+ 2 - 2
lisp/org-protocol.el

@@ -623,13 +623,13 @@ CLIENT is ignored."
             (let ((proto
 		   (concat the-protocol
 			   (regexp-quote (plist-get (cdr prolist) :protocol))
-			   "\\(:/+\\|\\?\\)")))
+			   "\\(:/+\\|/*\\?\\)")))
               (when (string-match proto fname)
                 (let* ((func (plist-get (cdr prolist) :function))
                        (greedy (plist-get (cdr prolist) :greedy))
                        (split (split-string fname proto))
                        (result (if greedy restoffiles (cadr split)))
-		       (new-style (string= (match-string 1 fname) "?")))
+		       (new-style (string-match "/*?" (match-string 1 fname))))
                   (when (plist-get (cdr prolist) :kill-client)
 		    (message "Greedy org-protocol handler.  Killing client.")
 		    (server-edit))