mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Refactor ein:insert-html-shr
This commit is contained in:
parent
74bb441400
commit
e755a90eb2
1 changed files with 6 additions and 6 deletions
|
@ -72,14 +72,14 @@ Usage::
|
||||||
(ein:insert-html-shr \"<b>HTML</b> string\")
|
(ein:insert-html-shr \"<b>HTML</b> 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)
|
end)
|
||||||
(ein:shr-insert-document
|
|
||||||
(with-temp-buffer
|
|
||||||
(erase-buffer)
|
|
||||||
(insert html-string)
|
|
||||||
;; FIXME: If URLs are local, they should be adapted here.
|
;; 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))
|
(setq end (point))
|
||||||
(put-text-property start end 'read-only t)
|
(put-text-property start end 'read-only t)
|
||||||
(put-text-property start end 'front-sticky t)))
|
(put-text-property start end 'front-sticky t)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue