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

Add .text_content to events that have .content #44

Closed
banksJeremy opened this issue May 2, 2014 · 2 comments
Closed

Add .text_content to events that have .content #44

banksJeremy opened this issue May 2, 2014 · 2 comments
Assignees

Comments

@banksJeremy
Copy link
Collaborator

It would be convenient to have a .text_content property on wrapper.Event which parses the HTML and returns a plain-text version of a message (html/xml entities interpreted, tags removed).

@banksJeremy banksJeremy self-assigned this May 2, 2014
@banksJeremy banksJeremy changed the title Add .text_content to events that has .content Add .text_content to events that have .content May 2, 2014
@banksJeremy
Copy link
Collaborator Author

Something that would be interesting to think about is html2text, which could give us markdown text from the incoming messages. However, this would probably be less useful for most bots than simply ignoring the HTML tags, so I'll probably use the built-in HTMLParser.HTMLParser().unescape().

(edit: oh, that method doesn't strip HTML tags, so it isn't enough.)

@banksJeremy
Copy link
Collaborator Author

Passed my Travis here and your Travis here. Merging into default.

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

No branches or pull requests

1 participant