Conversation
QualityReport.to_markdown() escaped only the description cell, so a column name containing "|" added an extra cell and shifted the Actions row, and newlines in any cell split the row. Escape every cell inside _md_table_row instead: "|" becomes "\|" and line breaks become "<br>". The manual per-description escape is removed so values are no longer double-escaped. Fixes FreshCode-Org#338
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Problem
In the Actions table of
QualityReport.to_markdown(), only the descriptioncell was escaped. A column named
a|btherefore added an extra cell andshifted the whole row, and a newline in any cell split the row. This breaks the
rendered table (issue #338).
Reproduction on
main:Fix
_md_table_rowvia a small_md_escape_cellhelper:
|becomes\|, and\r\n/\r/\nbecome<br>.a.description.replace("|", "\|")at the call siteso values are no longer double-escaped.
The separator/header rows contain no pipes or newlines, so their rendering is
unchanged.
Tests
test_md_table_row_escapes_pipe_and_newline— unit-covers pipe escaping andbare-
\r, CRLF and\nline breaks.test_quality_report_actions_table_survives_pipe_in_column_name— regressionfor QualityReport.to_markdown breaks the Actions table when a column name contains '|' #338: every Actions row keeps the header's column count and shows
a\|b.Verification (run locally)
pytest -m "not online and not large"— coverage gate reached (93.21%); theonly failures are 3 pre-existing, unrelated tests (
performance/test_runner_cli,test_experimental_ai_copilot,test_semantic_backends) that also fail on anunmodified
mainin this environment.pytest tests/test_enterprise_metrics.py --no-cov— all pass.ruff check .— clean.I also added a note under
Unreleased → FixedinCHANGELOG.md.