emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6639697: Allow shr to use data: URLs without encodi


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 6639697: Allow shr to use data: URLs without encoding
Date: Sun, 3 Dec 2017 17:48:10 -0500 (EST)

branch: master
commit 66396972ed5273516a77589c350f6ce9becd8d9f
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Allow shr to use data: URLs without encoding
    
    * lisp/net/shr.el (shr-image-from-data): Don't bug out on
    image data: URLs that have no base64 encoding like
    (shr-image-from-data
    "text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E").
---
 lisp/net/shr.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index ab7240c..ad5d869 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -994,7 +994,8 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
         data)
     (let ((param (match-string 4 data))
          (payload (url-unhex-string (match-string 5 data))))
-      (when (string-match "^.*\\(;[ \t]*base64\\)$" param)
+      (when (and param
+                 (string-match "^.*\\(;[ \t]*base64\\)$" param))
        (setq payload (ignore-errors
                         (base64-decode-string payload))))
       payload)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]