Skip to content

fix(notifications): Attach punctuation to the preceding text block - #133134

Closed
sentry-junior[bot] wants to merge 1 commit into
masterfrom
fix/notification-text-block-spacing
Closed

sentry-junior[bot] wants to merge 1 commit into
masterfrom
fix/notification-text-block-spacing

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Every notification platform renderer (email HTML and text, Slack, MS Teams, Discord, and NotificationRenderedTemplate.render_text_blocks) joined text blocks with a single space. When one block ends where another starts, as with a bold mention followed by a comma, the output picks up a stray space: *@Jane Doe* , thoughts?.

join_rendered_text_blocks now replaces those joins. It still puts a space between blocks, except:

  • before a block that starts with closing punctuation (, . ; : ! ? ))
  • when either side already has whitespace at the boundary, such as a newline in a multiline comment

This is a follow-up to #133114, which splits comment mentions into bold blocks and runs into this. The change has no dependency on that PR.

Templates that build sentences from blocks and put punctuation in its own block will lose the space before that punctuation. That's the intended result, but it applies to every template.

via @hobzcalvin.

--

View Session [Sentry]

Renderers joined text blocks with a space, so a bold mention followed by
a comma rendered as "@jane Doe , thoughts?". Skip the space before
closing punctuation and next to existing whitespace.

Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 1, 2026
@sentry-junior
sentry-junior Bot requested a review from hobzcalvin December 1, 2026 23:57
@sentry-junior sentry-junior Bot closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant