Skip to content

relizy / markdownToSlackRichText

Function: markdownToSlackRichText() ​

markdownToSlackRichText(markdown, __namedParameters?): SlackRichTextBlock[]

Defined in: src/core/slack-markdown.ts:842

Render a markdown changelog as Slack rich_text blocks. Commit bodies are rendered under their bullet: paragraphs as quotes, nested lists as indented lists, code as preformatted blocks. When maxLength, maxBlocks or maxPayloadLength is exceeded, the changelog is cut where the limit is reached, even inside a commit body, with an ellipsis, and the commits left out entirely are announced with an "… and N more changes" line.

Parameters ​

markdown ​

string

__namedParameters? ​

blockMaxLength? ​

number = SLACK_RICH_TEXT_BLOCK_MAX_LENGTH

Soft cap of the text characters of a single block

maxBlocks? ​

number = SLACK_MAX_BLOCKS

Maximum number of returned blocks

maxLength? ​

number

Maximum number of text characters of the changelog

maxPayloadLength? ​

number

Maximum length of the JSON of the returned blocks

Returns ​

SlackRichTextBlock[]

Released under the MIT License.