diff options
| author | Lars Ingebrigtsen | 2017-12-03 23:46:52 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2017-12-03 23:49:56 +0100 |
| commit | 4b06af0643d14b4e989a9360444b6ee0768ae99a (patch) | |
| tree | 71a91f3feceb40c6e0e1e92882d024ebcf84ed63 | |
| parent | 1fdac2d65c7134a2e1261bf7ad32d275f37da0dc (diff) | |
| download | emacs-4b06af0643d14b4e989a9360444b6ee0768ae99a.tar.gz emacs-4b06af0643d14b4e989a9360444b6ee0768ae99a.zip | |
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").
| -rw-r--r-- | lisp/net/shr.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index ab7240c8c3d..ad5d869531c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -994,7 +994,8 @@ If EXTERNAL, browse the URL using `shr-external-browser'." | |||
| 994 | data) | 994 | data) |
| 995 | (let ((param (match-string 4 data)) | 995 | (let ((param (match-string 4 data)) |
| 996 | (payload (url-unhex-string (match-string 5 data)))) | 996 | (payload (url-unhex-string (match-string 5 data)))) |
| 997 | (when (string-match "^.*\\(;[ \t]*base64\\)$" param) | 997 | (when (and param |
| 998 | (string-match "^.*\\(;[ \t]*base64\\)$" param)) | ||
| 998 | (setq payload (ignore-errors | 999 | (setq payload (ignore-errors |
| 999 | (base64-decode-string payload)))) | 1000 | (base64-decode-string payload)))) |
| 1000 | payload))) | 1001 | payload))) |