hansifer / tab-copy

A browser extension for copying tabs to the clipboard in a variety of formats.
http://tabcopy.com
Other
55 stars 16 forks source link

markdown copy injects escape characters that are interpreted literally in Slack (and probably other apps) #11

Open YAMLcase opened 1 day ago

YAMLcase commented 1 day ago

For tab titles with square brackets, it appears Tab Copy is injecting escape characters to deal with nested brackets. Unfortunately backslashes are interpreted literally in Slack and break the formatting (example below).

This behavior is new since the big overhaul of Tab Copy that was recently released so hopefully it's an easily identifiable bug that can be fixed. If not, here are some options I'd be happy with:

Copied using "Markdown" format from Tab Copy:

[\[PROJECT-123\] This is a test project - Jira](https://jira.mycompany.com/browse/PROJECT-123)

What slack shows: image

hansifer commented 13 hours ago

This is a fix in v4. Failing to escape was a bug. In fact, we still don't escape aggressively enough.

This is also indicative of a bug in Slack's handling of escaped Markdown links. It seems less than ideal to add logic to accommodate bugs, limitations, or non-standard behavior in 3rd party apps.

You could disable markup in Slack and use the Link format, although I'm sure you have your reasons for enabling it.

FWIW, there's two features on the roadmap that could be used to address such problems in the future and I'm happy to accept PRs for either: