Commit eadb6068 authored by Ivan Kanis's avatar Ivan Kanis Committed by Lars Magne Ingebrigtsen
Browse files

* net/shr.el (shr-render-region): New function.

parent 75dbaf9d
2013-06-28 Ivan Kanis <ivan@kanis.fr>
* net/shr.el (shr-render-region): New function.
* net/eww.el: Autoload `eww-browse-url'.
2013-06-27 Dmitry Gutov <dgutov@yandex.ru>
......
......@@ -166,6 +166,17 @@ cid: URL as the argument.")
(libxml-parse-html-region (point-min) (point-max))))
(goto-char (point-min)))
(defun shr-render-region (begin end &optional buffer)
"Display the HTML rendering of the region between BEGIN and END."
(interactive "r")
(unless (fboundp 'libxml-parse-html-region)
(error "This function requires Emacs to be compiled with libxml2"))
(with-current-buffer (or buffer (current-buffer))
(let ((dom (libxml-parse-html-region begin end)))
(delete-region begin end)
(goto-char begin)
(shr-insert-document dom))))
(defun shr-visit-file (file)
"Parse FILE as an HTML document, and render it in a new buffer."
(interactive "fHTML file name: ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment