Inbox remove html tags#348
Conversation
* Create new customizable faces `sx-inbox-item-type' and `sx-inbox-item-type-unread' to replace use of `font-lock-keyword-fase'. * Separate inbox items with a newline.
* correction for occurence of "propertize: Wrong type argument: sequencep, face". * adjust indent and vertical spacing for readability.
* Identify the link text with new face `sx-inbox-link'.
| (concat " " (propertize (or .title "") 'face 'sx-question-list-date) "\n" | ||
| (when .body | ||
| (let (end-1 start-2 text) | ||
| (while (and |
There was a problem hiding this comment.
Do you think there's any functionality in html-parsing elisp libraries that can help us out here? For example, maybe there's something in eww that will take this HTML string and turn it into displayable text for free.
There was a problem hiding this comment.
Probably. Also, it so happens that I'm a contributor to the emacs-w3m' project, and I use emacs as my main internet browser. In fact, my interest in sx.elis because the stackexchange internet interface requires javascript support which emacs browsers don't (can't?) offer. It's been years since I evaluated (and rejected)eww' for my personal use, but my memory is that it uses a package called `shr.el' and at least one other support package.
As for it being "free", nothing is really "free" from an efficiency standpoint, but I have no fundamental objection to using those libraries. A first-glance assessment of things to consider in making that decision:
- Does the project need "alot" of html support, or just rare minimal snippets? If the latter, do you want to add a dependency to the package for those minimal snippets? For dependencies outside of mainline emacs, this becomes an install/sync consideration, but if the dependencies are part of main-line emacs (and I think they are), it's only an additional (load ...)(require ...) for an already bloated emacs.
There was a problem hiding this comment.
By 'free' I tend to mean 'this package doesn't try to do a thing another package will do for us'. Eww is certainly not the most efficient piece of software I've ever seen :-)
If there is minimal support that can be had, I'd prefer to pull that minimal support out into a separate package and depend on that.
|
Is this something that's still valuable to merge after all this time? Happy to do so if so. |
The inbox text body was displaying raw html source code. The only tags I noticed were for links, so I replaced them with a link face. Strictly speaking, this is done only in one commit 09597f9, but that commit makes no sense unless the inbox feature is working, so it depends upon the other three.