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

Linkifier with automatic Fallback #11222

Open
xeruf opened this issue Jan 8, 2019 · 2 comments
Open

Linkifier with automatic Fallback #11222

xeruf opened this issue Jan 8, 2019 · 2 comments
Labels
area: markdown (linkifiers) area: settings (admin/org) difficult Issues which we expect to be quite difficult help wanted new feature A proposed new feature for the product

Comments

@xeruf
Copy link

xeruf commented Jan 8, 2019

I have a Zulip server that is about a GitHub organization, which has a few repositories. Thus, it would be nice if pasting a commit hash from any of the repositories would automatically link to the correct repo.

The solution I thought of is a Linkifier with fallback: You provide a default (i.e. url for repo1) and when that returns a 404 for a particular input, there is an alternative (url for repo2). This could be chained and Zulip would simply go through each link of the chain and find the first one that doesn't return a 404, and if all are 404, then don't turn it into a link at all.
The extra (milli)seconds this adds until the link is inserted wouldn't really bother since it only has to be performed once when the message is sent, but the extra convenience would be amazing and this could be used for far more than just commit hashes.

Discussion: https://chat.zulip.org/#narrow/stream/2-general/topic/Linkifier.20with.20automatic.20fallback

@zulipbot
Copy link
Member

zulipbot commented Jan 8, 2019

Hello @zulip/server-markdown, @zulip/server-settings members, this issue was labeled with the "area: markdown", "area: settings (admin/org)" labels, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

This would require a bit more architecture work than it might seem, since currently we don't fetch the link at all for realm filters in the markdown rendering phase. But would still be a nice improvement.

I'm tagging this as difficult since the refactoring involved will require some careful design work.

@timabbott timabbott added the difficult Issues which we expect to be quite difficult label Jan 8, 2019
@Gittenburg Gittenburg added the new feature A proposed new feature for the product label Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: markdown (linkifiers) area: settings (admin/org) difficult Issues which we expect to be quite difficult help wanted new feature A proposed new feature for the product
Projects
None yet
Development

No branches or pull requests

4 participants