From 7f9fae9eca114bc2981112795831dbd8f3e1f78c Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Wed, 19 Apr 2017 22:29:32 -0400 Subject: Render html with shr instead of html2text --- lisp/mastodon-tl.el | 8 +++++--- lisp/mastodon-toot.el | 1 - lisp/mastodon.el | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index e25f1d4..6c9b4e5 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -133,7 +133,10 @@ Return value from boosted content if available." (defun mastodon-tl--content (toot) "Retrieve text content from TOOT." (let ((content (mastodon-tl--field 'content toot))) - (propertize (mastodon-tl--remove-html content) + (propertize (with-temp-buffer + (insert content) + (shr-render-region (point-min) (point-max)) + (buffer-string)) 'face 'default))) (defun mastodon-tl--toot (toot) @@ -145,8 +148,7 @@ Return value from boosted content if available." (defun mastodon-tl--timeline (toots) (mapcar 'mastodon-tl--toot toots) - (html2text) - (replace-regexp "\n\n\n" "\n" nil (point-min) (point-max))) + (replace-regexp "\n\n\n | " "\n | " nil (point-min) (point-max))) ;; TODO ;; Look into the JSON returned here by Local diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index fc06e66..93980f0 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -70,7 +70,6 @@ STATUS is passed by `url-retrieve'." (defun mastodon-toot--action-success (marker) "Insert MARKER with 'success face in byline." (let ((inhibit-read-only t)) - (goto-char (+ 3 (point))) (insert (format "(%s) " (propertize marker 'face 'success))) (mastodon-tl--goto-prev-toot))) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 8abdb43..f96b5e3 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -62,7 +62,6 @@ :options '(provide-discover-context-menu) :group 'mastodon) -;; FIXME #25 (defun mastodon-version () "Message package version." (interactive) -- cgit v1.2.3