Skip to content

Escape & and an edge underscore in markdown report text (tester-army/e2e#1743, #2307) - #2308

Merged
kblok merged 1 commit into
mainfrom
fix/2263-markdown-escape-ampersand-underscore
Nov 27, 2026
Merged

kblok merged 1 commit into
mainfrom
fix/2263-markdown-escape-ampersand-underscore

Conversation

@kblok

@kblok kblok commented Nov 27, 2026

Copy link
Copy Markdown
Member

Closes #2263

What

Markdown report text (MarkdownText.Cell) now escapes & as & and escapes an underscore at the edge of a word. Port of e2e-inc/e2e#1743 (c371f78) and #2307 (ae2a893).

Value

A test title or error message holding entity text (©, <b>) shows as written instead of rendering as a character. __proto__ or _id_ is no longer rendered bold or italic in the GitHub comment. Underscores between letters/digits (ERROR_CODE, snake_case) and a lone _/__ token stay as written.

Upstream parity

Verdict: full port of report/markdown-text.ts (escapeInline + escapeEdgeUnderscores; C# EscapeInline, EscapeUnderscores/EscapeEdgeUnderscores). Same order: backslash escapes, underscores, then &, <, >. Doc comments updated. No public API or docs change (internal type; no docs mention it).

  • & escaped first among entities
  • edge-underscore rule (word char = letter or digit; whole-token run kept)

Upstream tests -> local

report-markdown.test.ts, describe('renderMarkdownReport'), in tests/E2E.Tests/ReportMarkdown/RenderMarkdownReportTests.cs:

  • escapes an ampersand, so entity text in a title or a message shows as written -> Escapes_an_ampersand_so_entity_text_in_a_title_or_a_message_shows_as_written
  • escapes an underscore at the edge of a word, ... -> Escapes_an_underscore_at_the_edge_of_a_word_so_a_title_or_a_message_is_not_bold_or_italic
  • keeps an entity from decoding into a mention or an issue link, ... -> Keeps_an_entity_from_decoding_into_a_mention_or_an_issue_link_and_leaves_an_ampersand_inside_a_code_span_alone

Not ported

Nothing. Real-model tests not run: report formatting only, no agent change. E2E.Tests ReportMarkdown + Traces: 156 passed (net10.0).

Note: upstream's word-char check works on UTF-16 units, so a non-BMP letter beside an underscore gets a needless backslash; kept as upstream.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0aa708c and 472afa2.

Files selected for processing: 2

  • src/E2E/Report/MarkdownText.cs
  • tests/E2E.Tests/ReportMarkdown/RenderMarkdownReportTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@kblok
kblok merged commit d8adb72 into main Nov 27, 2026
7 of 8 checks passed
@kblok
kblok deleted the fix/2263-markdown-escape-ampersand-underscore branch November 27, 2026 13:21
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.

Upstream: escape & and an edge underscore in markdown report text (tester-army/e2e#1743, #2307)

2 participants