Skip to content

fix(editor): add code block highlighting and controls - #2604

Closed
khoinguyenpham04 wants to merge 10 commits into
mainfrom
codex/issue-2361-code-block-controls
Closed

fix(editor): add code block highlighting and controls#2604
khoinguyenpham04 wants to merge 10 commits into
mainfrom
codex/issue-2361-code-block-controls

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes code blocks in the admin and inline visual editors so supported languages are syntax-highlighted on borderless light and dark surfaces. It also adds matching controls for choosing a language and copying code while preserving unsupported language values as plain text.

This is the bottom pull request in the code-block editor stack. The focused visual-polish follow-up is #2603.

Closes #2361

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes — verified for the affected admin and core packages
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). No catalog files are included.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package) — .changeset/bright-code-blocks.md and .changeset/gentle-code-block-controls.md
  • New features link to an approved Discussion: N/A — this fixes existing editor behavior

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenAI GPT-5.6 Codex, reviewed with GPT-5.6 Terra xhigh

Screenshots / test output

  • Type-aware lint passed.
  • Admin and core typechecks passed.
  • Admin editor tests: 71 passed.
  • Inline code-block tests: 9 passed.
  • Admin and core builds completed.
  • Browser-verified syntax highlighting, themes, copy feedback, language selection, responsive placement, and RTL behavior in both editors.
  • The focused Playwright suite is included; its isolated local runner is currently blocked by the existing fixture-dependency build step, so the equivalent flows were also verified directly against the local app.

@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f2aab6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 2f2aab6 Aug 22 2026, 06:16 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 2f2aab6 Aug 22 2026, 06:15 PM

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 2,657 lines across 19 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 2f2aab6 Aug 22 2026, 06:15 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-issue-2361-code-block-controls.try.emdashcms.com, https://codex-issue-2361-code-block-controls-emdash-playground.emdash-cms.workers.dev (commit 2f2aab6)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://633b0ac5.try.emdashcms.com, https://633b0ac5-emdash-playground.emdash-cms.workers.dev 2f2aab6 2026-08-22T18:16:07.634Z Visit the dashboard ↗

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2604

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2604

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2604

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2604

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2604

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2604

emdash

npm i https://pkg.pr.new/emdash@2604

create-emdash

npm i https://pkg.pr.new/create-emdash@2604

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2604

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2604

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2604

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2604

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2604

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2604

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2604

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2604

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2604

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2604

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2604

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2604

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2604

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2604

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2604

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2604

commit: 2f2aab6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor code blocks lack syntax highlighting and correct light/dark theme styling

1 participant