Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inbox remove html tags #348

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Boruch-Baum
Copy link
Contributor

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.

* 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'.
@vermiculus vermiculus mentioned this pull request Feb 12, 2018
(concat " " (propertize (or .title "") 'face 'sx-question-list-date) "\n"
(when .body
(let (end-1 start-2 text)
(while (and
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vermiculus
Copy link
Owner

Is this something that's still valuable to merge after all this time? Happy to do so if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants