slack icon indicating copy to clipboard operation
slack copied to clipboard

"Spaceship operator" corruption in GitHub link unfurling

Open sambostock opened this issue 3 years ago • 5 comments

Describe the bug

When a link to a file in GitHub is unfurled into a code snippet, if that file includes Ruby's "spaceship operator" (<=>), it is corrupted.

To Reproduce Steps to reproduce the behavior:

  1. Visit https://github.com/sambostock/slack-unfurling-spaceship-operator-bug/blob/main/example.rb#L1 and note the file's contents
  2. In a Slack instance with the GitHub integration, send a message including the link above
  3. After the link is unfurled, notice the <=> has been corrupted (into a link)

Expected behavior <=> should be rendered the same as all the other code

Screenshots

GitHubimage
Slack Desktopimageimage
Slack Mobile

Desktop (please complete the following information):

  • OS: macOS Ventura 13.0.1 (22A400)
  • Slack: Version 4.29.149 5581973fc9076ce89148bd7f26d8b25b070d3bf8@1669945041 (App Store)
  • Browser: Chrome, Version 108.0.5359.98 (Official Build) (arm64)

Smartphone (please complete the following information):

  • Device: Google Pixel 6 Pro
  • OS: Android 13
  • Slack: 22.12.10.0-90012019-11629

Additional context

Not sure if this is a bug in the GitHub Slack integration, or if it's a bug in Slack itself. My guess is the GitHub integration, as Slack code blocks and snippets don't have this issue. Nonetheless, I've also reported this to Slack directly.

sambostock avatar Dec 09 '22 19:12 sambostock

Slack support confirmed this is a bug in the GitHub integration.

sambostock avatar Dec 09 '22 22:12 sambostock

@nikhilgarg1047 Can you get someone to look into this issue.

ashokirla avatar Dec 12 '22 02:12 ashokirla

Thank you for bringing this to our attention, we are looking into it

jeetmehta13 avatar Dec 12 '22 07:12 jeetmehta13

Hi, are you still looking into it? This appears to still happen.

Note that it's not just the "spaceship operator" that's impacted but anything with "<" and ">" and something in between, such as Rust's generic types and presumably C++ templates as well.

Rust examples:

  • Vec<u8> becomes Vecu8
  • HashMap<(Vec<u8>, Vec<u8>, bool), u64> becomes HashMap(Vec<u8, Vecu8, bool), u64>

sooda avatar Dec 12 '23 10:12 sooda

Hey @sooda, I don't work at GitHub anymore so I cannot help fix this, sorry!

jeetmehta13 avatar Dec 12 '23 17:12 jeetmehta13