Skip to content

Commit

Permalink
Merge pull request #5 from clearfeed/APP-4559
Browse files Browse the repository at this point in the history
APP-4559 fix rendering group mention
  • Loading branch information
batflarrow authored Sep 16, 2024
2 parents 89918ea + fad75fe commit 3ece4ca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clearfeed-ai/slack-to-html",
"version": "1.0.6",
"version": "1.0.7",
"description": "Render Slack markdown as HTML",
"main": "dist/bundle.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const replaceUserGroupName = (usergroups) => (match) => {
match.subteamName ||
(match.subteamID && usergroups && usergroups[match.subteamID])
if (userGroupName) {
return `${userGroupName}`
return `@${userGroupName}`
}
return escapeTags(match.toString())
}
Expand Down
8 changes: 6 additions & 2 deletions test/controlSequenceTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ describe('control sequences', () => {

describe('for the subteam command', () => {
it('should render as a group link when the label is present', () => {
escapeForSlack('<!subteam^S123|swiftype-eng>').should.equal('swiftype-eng')
escapeForSlack("<!subteam^S123|swiftype-eng>").should.equal(
"@swiftype-eng"
);
})

it('should render the group name if present', () => {
escapeForSlack('<!subteam^S123>', { usergroups: { S123: 'swiftype-eng' } }).should.equal('swiftype-eng')
escapeForSlack("<!subteam^S123>", {
usergroups: { S123: "swiftype-eng" },
}).should.equal("@swiftype-eng");
})

it('should render the original value if the channel name is not present', () => {
Expand Down

0 comments on commit 3ece4ca

Please sign in to comment.