Comments (4)
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.
@RagnarGrootKoerkamp - Did you come up with a solution for this. I am also having this issue at the moment.
from slack-notifier.
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.
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)
- Slack Notifier & Singleton ? HOT 2
- Allow support for legacy/bot tokens, not just webhooks
- Link formatting not working correctly for markdown links inside parenthesis
- tagging someone does not tag them HOT 6
- Notification seems not send always HOT 1
- Does this gem support Slack's new 'block' message format? HOT 3
- ping with channel option does not override webhook channel HOT 3
- Usernames with spaces HOT 3
- Ruby 2.7 deprecation warnings HOT 1
- ⚠️ looking for a maintainer ⚠️ HOT 4
- Retry if post fails because of rate limiting HOT 12
- Ruby 3.0.0, LinkFormatter, positional/keyword/default arguments issue on #initialize HOT 6
- Is there any way to send postEphemeral?
- Exclusion of inactive/merged branches
- channel and username params doesn't work HOT 2
- Customize private messages webhook bot
- How to not use ssl? HOT 16
- Gem available in rubygem.org doesn't match this code HOT 1
- Is the stack trace limited? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-notifier.