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

Allow URL-encoding of variables in template #177

Open
ChristophKaser opened this issue Dec 7, 2021 · 1 comment
Open

Allow URL-encoding of variables in template #177

ChristophKaser opened this issue Dec 7, 2021 · 1 comment

Comments

@ChristophKaser
Copy link

My company uses the autolink-plugin to detect filenames in chat messages and convert them to a URL with a custom protocol that is used to open the file in the IDE. This works really well in most browsers, however the mattermost desktop client does not open these URLs. The reason is that the file paths contain backslashes (), so the URL with the file name is technically invalid. The browsers seem to automatically encode the illegal characters, but the desktop client refuses to open such links.

The best solution IMHO would be to add the possibility to url encode values in the template. This could be done by adding a prefix to the variable name, like this:
Template: [$match](editor_launcher:${urlEncode:path})

(Additional prefixes that might be useful: base64Encode, toLower, toUpper, ...)

@Jay2k1
Copy link

Jay2k1 commented May 30, 2024

+1!
Our use case is different, I wanted to abuse the auto linker as URL shortener. We use a web app (Kibana) that generates veeeeery long URLs (3000+ characters), and my idea was to detect these and link them with a short text instead.

It successfully detects the links and applies the replacement, but because these URLs contain parentheses, colons and asterisks, the markdown parser interferes and doesn't parse the URL as a valid link (this is actually a mattermost issue, it breaks the URL in the same way). If the auto linker could urlencode, I could easily solve this.

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

2 participants