From e755a90eb21ed9461072896013daa52bcfcf2772 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 6 Sep 2012 19:09:02 +0200 Subject: [PATCH] Refactor ein:insert-html-shr --- lisp/ein-output-area.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/ein-output-area.el b/lisp/ein-output-area.el index b65cb48..2a5cce8 100644 --- a/lisp/ein-output-area.el +++ b/lisp/ein-output-area.el @@ -72,14 +72,14 @@ Usage:: (ein:insert-html-shr \"HTML string\") " - (let ((start (point)) + (let ((dom (with-temp-buffer + (erase-buffer) + (insert html-string) + (libxml-parse-html-region (point-min) (point-max)))) + (start (point)) end) - (ein:shr-insert-document - (with-temp-buffer - (erase-buffer) - (insert html-string) ;; FIXME: If URLs are local, they should be adapted here. - (libxml-parse-html-region (point-min) (point-max)))) + (ein:shr-insert-document dom) (setq end (point)) (put-text-property start end 'read-only t) (put-text-property start end 'front-sticky t)))