Skip to content

Conversation

@Eulenhorn
Copy link

Updated the set accessors for DescriptionMarkdown and NotesMarkdown properties to replace tabs and spaces with non-breaking spaces. This fixes a bug making Text appear with a white background and being unreadable.

Updated the set accessors for DescriptionMarkdown and NotesMarkdown properties to replace tabs and spaces with non-breaking spaces.
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a rendering bug where markdown text was displaying with a white background, making it unreadable. The fix replaces tabs and four consecutive spaces with non-breaking spaces in markdown properties to prevent the rendering issue.

  • Modified the DescriptionMarkdown and NotesMarkdown property setters to transform whitespace characters
  • Replaced tabs and four-space sequences with four non-breaking space characters (\u00A0)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +68
descriptionMarkdown = value?
.Replace("\t", "\u00A0\u00A0\u00A0\u00A0")
.Replace(" ", "\u00A0\u00A0\u00A0\u00A0");
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replacement values "\u00A0\u00A0\u00A0\u00A0" are magic strings that appear multiple times without explanation. The decision to replace tabs and four spaces with exactly four non-breaking spaces is not documented. Consider extracting these as named constants with clear documentation explaining why this specific replacement is necessary for fixing the white background issue.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +68
descriptionMarkdown = value?
.Replace("\t", "\u00A0\u00A0\u00A0\u00A0")
.Replace(" ", "\u00A0\u00A0\u00A0\u00A0");
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string.Replace method operates sequentially, which can lead to unintended behavior. When " " (four spaces) is replaced with four non-breaking spaces, if the original text contains sequences of more than four spaces, each group of four consecutive spaces will be replaced independently. For example, eight consecutive spaces would become eight non-breaking spaces (correct), but six consecutive spaces would become four non-breaking spaces followed by two regular spaces (inconsistent). Consider replacing multiple spaces in a single operation or using a more comprehensive approach to handle all space sequences consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +81
notesMarkdown = value?
.Replace("\t", "\u00A0\u00A0\u00A0\u00A0")
.Replace(" ", "\u00A0\u00A0\u00A0\u00A0");
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace replacement logic is duplicated in both DescriptionMarkdown and NotesMarkdown setters. This violates the DRY principle and makes maintenance more difficult. If the replacement logic needs to be changed in the future, it will need to be updated in both places. Consider extracting this logic into a private helper method.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📃 New Issues

Development

Successfully merging this pull request may close these issues.

1 participant