Skip to content

Commit

Permalink
[FIX] Slack importer Link handling (#17595)
Browse files Browse the repository at this point in the history
* Fixed Link import

* Fixed import of named URLs, since pipes get encoded as %7C we can safely escape |
  • Loading branch information
lpilz authored May 19, 2020
1 parent a720d25 commit bdcac83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/importer-slack/server/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,8 @@ export class SlackImporter extends Base {
message = message.replace(/:memo:/g, ':pencil:');
message = message.replace(/:piggy:/g, ':pig:');
message = message.replace(/:uk:/g, ':gb:');
message = message.replace(/<(http[s]?:[^>|]*)>/g, '$1');
message = message.replace(/<(http[s]?:[^|]*)\|([^>]*)>/g, '[$2]($1)');
message = message.replace(/<(http[s]?:[^>]*)>/g, '$1');

for (const userReplace of Array.from(this.userTags)) {
message = message.replace(userReplace.slack, userReplace.rocket);
Expand Down

0 comments on commit bdcac83

Please sign in to comment.