Skip to content

The best way of parsing URLs in Slack text #322

Description

@tomerbsentinel

I wonder if there is a "best practice" or everyone is building their own URL parsing mechanism.
Slack are formatting the text into hyperlinks, and I need to overcome this.

I'm getting URLs like: (depends who entered it to the text input)
only text - google.com
short URL - <google.com|google.com>
Long URL - <https://google.com|google.com>

  1. I didn't see it, but, do we have the exact input of the end-user
  2. Do anyone have a good practice of how to get only the text out of the pre-formatted command?

Activity

  1. seratch commented on May 5, 2021

    @seratch
    Contributor

    Hi @tomerbsentinel , thanks for asking the question!

    I didn't see it, but, do we have the exact input of the end-user

    No, we don't. Only the top-level text property in a payload is available for apps.

    Do anyone have a good practice of how to get only the text out of the pre-formatted command?

    We're still consulting other experts but, as far as I know, there is no standard way to do so. For your use case, the current recommendation would be writing your own parser. 🙇

  2. seratch commented on May 9, 2021

    @seratch
    Contributor

    👋 I will close this issue soon. Let us know if you have something further to ask/discuss here!

  3. changed the title [-]best way of URL handling[/-] [+]The best way of parsing URLs in a message[/+] on Jun 19, 2021
  4. changed the title [-]The best way of parsing URLs in a message[/-] [+]The best way of parsing URLs in Slack text[/+] on Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions