Skip to content

refactor(code-help): escape snippets centrally instead of in source strings#8062

Draft
talissoncosta wants to merge 1 commit into
mainfrom
refactor/highlight-escaping
Draft

refactor(code-help): escape snippets centrally instead of in source strings#8062
talissoncosta wants to merge 1 commit into
mainfrom
refactor/highlight-escaping

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Split out of #8023 to keep that PR to theming only.

Changes

Escape code snippets centrally in Highlight instead of hand-escaping HTML entities in the source strings.

  • Highlight always escapes now (dropped the preventEscape branch). MCPSnippet and CodeHelp no longer pass preventEscape.
  • Code-help snippet sources use raw JSX/HTML (<FlagsmithProvider>) instead of pre-escaped entities (&lt;), so they read like real code. Highlight escapes at render, so the output is unchanged.

How did you test this code?

Rendered the SDK code snippets (CodeHelp) and MCP snippet; confirmed tags like <FlagsmithProvider> display correctly and syntax highlighting is intact, matching the previous output.

Highlight now always escapes (dropped the preventEscape branch); MCPSnippet
and CodeHelp no longer pass preventEscape. Code-help sources use raw JSX
(<FlagsmithProvider>) instead of hand-escaped entities (&lt;), so they're
readable. Rendered output is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jul 21, 2026 7:53pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 21, 2026 7:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Jul 21, 2026 7:53pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 371d3507-26c6-4a66-868a-2195a7b7b214

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jul 21, 2026
talissoncosta added a commit that referenced this pull request Jul 21, 2026
Keep this PR theming-only. preventEscape removal + code-help source
de-escaping move to #8062. Highlight keeps embedded + the de-nested
getRawHtml (retaining preventEscape); escaping behaviour is unchanged here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants