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

Links should be "openable" #43

Closed
benjajaja opened this issue Feb 23, 2023 · 3 comments
Closed

Links should be "openable" #43

benjajaja opened this issue Feb 23, 2023 · 3 comments
Assignees
Milestone

Comments

@benjajaja
Copy link
Contributor

Most links are longer than the chat-message-grid-column, and thus are broken up into the next line. Then, they cannot be opened by clicking (most modern terminals have such a feature), nor can they be selected easily for copying and pasting.

If a message has no attachments and :open is used, then do a simple match for ^http(s)?://.+ or something like that, and pass a match to the open crate, it should open the browser.

@ptman
Copy link

ptman commented Mar 10, 2023

weechat has raw-mode (M-L), which is quite handy for links

@benjajaja
Copy link
Contributor Author

@ptman what does that do? Something like just printing raw chat lines?

@ulyssa
Copy link
Owner

ulyssa commented Oct 8, 2023

Implemented in df3148b. I made it so that <a> tags get a [0], [1], etc. shown after them, so that it's clear when someone's used markdown to link to something, and I've made it so that running :open will open a prompt showing the URLs and asking which number (or letter if you have enough links) you want to open.

If the message is plaintext only, then :open will try to parse the message body to see if it's just a URL. There might be room for improvement here for when it's a plaintext message containing multiple URLs, but I imagine that this should be a good step forward for now.

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

No branches or pull requests

3 participants