Skip to content

Add line breaks between issues and hot-spots in markdown reports#62

Merged
Malcolmnixon merged 4 commits intomainfrom
copilot/enforce-line-breaks-in-report
Jan 24, 2026
Merged

Add line breaks between issues and hot-spots in markdown reports#62
Malcolmnixon merged 4 commits intomainfrom
copilot/enforce-line-breaks-in-report

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Pull Request

Description

Markdown renderers (pandoc, weasyprint) merge consecutive lines without line separators into single paragraphs. Issues and hot-spots were being written on consecutive lines, causing them to merge into unreadable text blocks.

Changes:

  • Modified AppendIssuesSection() and AppendHotSpotsSection() to add two trailing spaces at the end of each line
  • Added tests verifying trailing spaces occur immediately before line endings using Environment.NewLine for cross-platform compatibility
  • Uses markdown hard line breaks (two trailing spaces) instead of paragraph breaks (blank lines)

Before:

src/File1.cs(10): MAJOR BUG [rule1] First issue
src/File2.cs(20): MINOR CODE_SMELL [rule2] Second issue

Renders as single merged line.

After:

src/File1.cs(10): MAJOR BUG [rule1] First issue  
src/File2.cs(20): MINOR CODE_SMELL [rule2] Second issue  

Renders as separate, readable lines on consecutive lines without extra paragraph spacing.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All tests pass: dotnet test --configuration Release
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint '**/*.{yml,yaml}'

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

Two new tests added to verify markdown contains two trailing spaces for hard line breaks. Tests use Environment.NewLine to ensure the two spaces occur immediately before the line ending, providing precise validation that works with both LF and CRLF line endings. All 76 tests passing with zero warnings.

The two-space approach creates markdown hard line breaks, keeping items on consecutive lines without merging them together, while being more markdown-idiomatic than blank line paragraph breaks.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Enforce line breaks on results</issue_title>
<issue_description>### Problem Statement

When compiling the SonarMark Markdown report using pandoc/weasyprint, the issues merge together into a single text block.

Proposed Solution

The Markdown output needs to be modified to ensure line breaks for issue and hot-spot items.

Alternatives Considered

No response

Usage Examples

Benefits

Clarity of reports.

Priority

High - Blocking my use case

Willingness to Contribute

Yes, I can submit a pull request

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the feature
  • I have explained why this feature would be useful</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Modify Markdown output to enforce line breaks in reports Add line breaks between issues and hot-spots in markdown reports Jan 23, 2026
Copilot AI requested a review from Malcolmnixon January 23, 2026 21:31
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…e ending

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Enforce line breaks on results

2 participants