Skip to content

Escape mrkdwn control characters in the example Slack template - #40

Merged
archlemon merged 1 commit into
mainfrom
fix/slack-escape
Nov 14, 2026
Merged

archlemon merged 1 commit into
mainfrom
fix/slack-escape

Conversation

@archlemon

Copy link
Copy Markdown
Member

Fixes #30 (approved: escape in template, no new func).

-m 'List<String> & <!channel>' -s 'a>b' now renders valid JSON with text *a&gt;b*\nList&lt;String&gt; &amp; &lt;!channel&gt; — displayed literally by Slack, no mention triggered. & is replaced first so entities aren't double-escaped.

Slack requires &, < and > in message text to be escaped. Unescaped,
`List<String>` was mangled and a literal `<!channel>` in piped output
would ping the whole channel. Escape subject and message with nested
replace calls; no new template function.

Fixes #30
@archlemon archlemon added the bug Something isn't working label Nov 14, 2026
@archlemon
archlemon merged commit 7b5cbde into main Nov 14, 2026
2 checks passed
@archlemon
archlemon deleted the fix/slack-escape branch November 14, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example Slack template does not escape mrkdwn control characters

1 participant