Repository navigation
fix(notifications): Attach punctuation to the preceding text block - #133134
Closed
sentry-junior[bot] wants to merge 1 commit into
Closed
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
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>
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.
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_blocksnow replaces those joins. It still puts a space between blocks, except:, . ; : ! ? ))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]