]> code.delx.au - gnu-emacs/commitdiff
Make the `R' command get the correct relative <img>s
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Feb 2016 02:51:45 +0000 (13:51 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Feb 2016 02:51:45 +0000 (13:51 +1100)
* lisp/net/eww.el (eww-readable): Preserve the base URL so
that image expansions are fetched from the right place (bug#22605).

lisp/net/eww.el

index 6a5fb4bdcf0490ffbce43975b2adb2f366a249ec..fdac46483c7af7fa4e6c0ea719fdc497a38ab329 100644 (file)
@@ -625,11 +625,13 @@ the like."
                (condition-case nil
                    (decode-coding-region (point-min) (point-max) 'utf-8)
                  (coding-system-error nil))
-               (libxml-parse-html-region (point-min) (point-max)))))
+               (libxml-parse-html-region (point-min) (point-max))))
+         (base (plist-get eww-data :url)))
     (eww-score-readability dom)
     (eww-save-history)
     (eww-display-html nil nil
-                     (eww-highest-readability dom)
+                      (list 'base (list (cons 'href base))
+                            (eww-highest-readability dom))
                      nil (current-buffer))
     (dolist (elem '(:source :url :title :next :previous :up))
       (plist-put eww-data elem (plist-get old-data elem)))