Repository navigation
feat(notifications): Render comment Markdown natively with a MarkdownSection - #133114
Open
sentry-junior[bot] wants to merge 8 commits into
Open
sentry-junior[bot] wants to merge 8 commits into
sentry-junior[bot] wants to merge 8 commits into
Conversation
The comment composer saves mentions as **@name** and **#team**. The comment notification template passed that text through as plain text, so email and Slack showed the literal asterisks. Split the comment into bold and plain text blocks so each renderer formats the mentions. Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
Strip only spaces from comment segments, so a mention on its own line doesn't collapse a multiline comment into one line.
Replace the bold-only regex with mistune's AST, so comment notifications also render code, italics, links, paragraphs, lists, and code blocks, and `**` inside code stays literal. Links that aren't http, https, or mailto render as plain text. Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
Comments are Markdown, so the note template now passes them through as a MarkdownSection instead of parsing them into text blocks. Each provider renders it natively: a Slack markdown block, escaped HTML from mistune in email, and the raw Markdown in plaintext email, Discord, and MS Teams. Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
hobzcalvin
reviewed
Dec 2, 2026
hobzcalvin
reviewed
Dec 2, 2026
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
hobzcalvin
reviewed
Dec 2, 2026
Co-Authored-By: Grant Patterson <grant.patterson@sentry.io>
Contributor
kcons
approved these changes
Dec 3, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Issue comments are Markdown, and the comment composer saves each mention as bold (
**@Jane Doe**). The comment notification template passed the text through as onePlainTextBlock, so email and Slack showed the raw Markdown:**@Jane Doe** works!This adds a
MarkdownSectionto the notification platform. A template puts Markdown source in it, and each provider renders it natively instead of the template parsing it into text blocks:markdownblock, which takes standard Markdown. The text is truncated to the block's 12,000 character limit.escape=True, which escapes raw HTML and replaces unsafe link schemes such asjavascript:.The note template now returns its comment as a
MarkdownSection. Because the comment is never split into blocks, mentions next to punctuation and line breaks keep their original spacing.The template puts
>in front of every line of the comment, so it still renders as a quote in Slack, email, and Discord. MS Teams doesn't support quotes and shows a literal>. As in the Sentry UI, single newlines inside a paragraph render as spaces in email HTML.The
/debug/notificationspreviewer skips section types it doesn't know, so it won't show the comment until #133321 teaches itmarkdown.via @hobzcalvin.
--
View Session [Sentry]