From 132f4472f5f066948e69894bac8ff27430e82012 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sun, 3 Sep 2017 20:42:01 -0400 Subject: [PATCH] Hexify strings in EWW search queries 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2fc36e180ee..03d9172b655 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -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) -- 2.39.2