diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-01 21:51:23 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-01 21:51:23 +0200 |
commit | 25f45d710e91a7c1049f056ff27bc3e6968f5624 (patch) | |
tree | 3edb81e704b49efe5b4f618d605ff85ab5735626 /lisp/net/shr.el | |
parent | 9b54d2b66e1ea70305897fe8c8d01b555611c29a (diff) | |
download | emacs-25f45d710e91a7c1049f056ff27bc3e6968f5624.tar.gz emacs-25f45d710e91a7c1049f056ff27bc3e6968f5624.tar.bz2 emacs-25f45d710e91a7c1049f056ff27bc3e6968f5624.zip |
Avoid bugging out on multibyte SVG data in shr
* lisp/net/shr.el (svg--wrap-svg): Ensure that the SVG data is
unibyte.
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r-- | lisp/net/shr.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index dc3cc38c798..ef236bf7c48 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1199,7 +1199,9 @@ Return a string with image data." "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xi=\"http://www.w3.org/2001/XInclude\" style=\"color: %s;\" viewBox=\"0 0 %d %d\"> <xi:include href=\"data:image/svg+xml;base64,%s\"></xi:include></svg>" (face-foreground 'default) (car size) (cdr size) - (base64-encode-string data t))) + (base64-encode-string (encode-coding-string + data (car (detect-coding-string data))) + t))) (buffer-string)))) (defun shr-image-displayer (content-function) |