]> git.eshelyaron.com Git - emacs.git/commitdiff
Hexify strings in EWW search queries
authorMark Oteiza <mvoteiza@udel.edu>
Mon, 4 Sep 2017 00:42:01 +0000 (20:42 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Mon, 4 Sep 2017 00:42:01 +0000 (20:42 -0400)
Previously, inputting "cats & dogs" would lose dogs because the
ampersand signifies a query parameter.  Instead, hexify each word while
preserving quotes with split-string.
* lisp/net/eww.el (eww--dwim-expand-url): Join hexified words together
with + separators, instead of replacing whitespace with +.

lisp/net/eww.el

index 2fc36e180eef48af013eb00226e6443990fabcc6..03d9172b655d7bd8e39c9136ffbb3edea597d5b1 100644 (file)
@@ -297,7 +297,8 @@ word(s) will be searched for via `eww-search-prefix'."
                (when (string= (url-filename (url-generic-parse-url url)) "")
                  (setq url (concat url "/"))))
            (setq url (concat eww-search-prefix
-                             (replace-regexp-in-string " " "+" url))))))
+                             (mapconcat
+                              #'url-hexify-string (split-string url) "+"))))))
   url)
 
 ;;;###autoload (defalias 'browse-web 'eww)