GithubHelp home page GithubHelp logo

Comments (4)

RagnarGrootKoerkamp avatar RagnarGrootKoerkamp commented on May 26, 2024 1

https://gitlab.com/gitlab-org/gitlab/-/issues/31263#note_215961096
That fixed it for me at the time: I just create slack formatted links directly in gitlab instead of having markdown links converted to slack links at a later point.

Not sure if it still works though; I lost those local changes after updating and didn't bother to make them again.

from slack-notifier.

stevebissett avatar stevebissett commented on May 26, 2024

@RagnarGrootKoerkamp - Did you come up with a solution for this. I am also having this issue at the moment.

from slack-notifier.

RagnarGrootKoerkamp avatar RagnarGrootKoerkamp commented on May 26, 2024

Here's a page explaining a general regex for matching links in markdown: https://medium.com/@michael_perrin/match-markdown-links-with-advanced-regex-features-fc5f9f4122bc

It uses the following for matching the [..] part:

(?<text_group>                  # Text group, including square brackets
  \[
    (?>                         # (?> defines an atomic group, this is a performance improvement when using recursion
      [^\[\]]+                  # Look for any char except closing square bracket
      |(?&text_group)           # OR: find recursively an other pattern with opening and closing square brackets
    )*
  \]
)

I'd hope that putting that bit of code here should do the trick.

I'd do it myself but don't have any Ruby experience. Maybe you can test it and create a PR @stevebissett

from slack-notifier.

stevebissett avatar stevebissett commented on May 26, 2024

Thanks @RagnarGrootKoerkamp - I landed up working around this by going the conversion before using the Slack formatter, because it was easy to do so in my use case.

I did have a go at trying to adjust the regex's and markdown handling to support this but I haven't managed to find working code that makes the spec pass. I am not all that familiar with Regex's at this complexity.

I have pushed up a spec for it here:
#120

I did have a look at some other Ruby markdown converters like redcarpet and the RDoc markdown to try and get a better idea of some alternative approaches but didn't come right.

from slack-notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.