From ebeb6de2caa938815bf31c5d5996a6899b1de954 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Tue, 2 Mar 2021 16:15:05 -0800 Subject: [PATCH] groups authors --- plugins/slack/__tests__/__snapshots__/slack.test.ts.snap | 3 ++- plugins/slack/__tests__/slack.test.ts | 1 + plugins/slack/src/index.ts | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/slack/__tests__/__snapshots__/slack.test.ts.snap b/plugins/slack/__tests__/__snapshots__/slack.test.ts.snap index afd0d24a9..9c9e115b0 100644 --- a/plugins/slack/__tests__/__snapshots__/slack.test.ts.snap +++ b/plugins/slack/__tests__/__snapshots__/slack.test.ts.snap @@ -170,7 +170,8 @@ Array [ Object { "elements": Array [ Object { - "text": "• Andrew Lisowski ()", + "text": "• Andrew Lisowski () +• Other", "type": "mrkdwn", }, ], diff --git a/plugins/slack/__tests__/slack.test.ts b/plugins/slack/__tests__/slack.test.ts index 3de232f98..f74247d02 100644 --- a/plugins/slack/__tests__/slack.test.ts +++ b/plugins/slack/__tests__/slack.test.ts @@ -503,6 +503,7 @@ describe("convertToBlocks", () => { #### Authors: 1 - Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) + - Other `) ) ).toMatchSnapshot(); diff --git a/plugins/slack/src/index.ts b/plugins/slack/src/index.ts index 9065d0a56..07b4dbed5 100644 --- a/plugins/slack/src/index.ts +++ b/plugins/slack/src/index.ts @@ -126,12 +126,15 @@ export function convertToBlocks( } else if (line.startsWith("*Authors:")) { currentMessage.push(createDividerBlock()); currentMessage.push(createContextBlock(line)); + const authorLines: string[] = []; for (const authorLine of lineIterator) { if (authorLine) { - currentMessage.push(createContextBlock(authorLine)); + authorLines.push(authorLine); } } + + currentMessage.push(createContextBlock(authorLines.join("\n"))); } else if (line.match(CHANGELOG_LINE)) { const lines: string[] = [line];