Skip to content

fix(editor): use 'strike' mark name for inspector strikethrough#3567

Open
Btocode wants to merge 1 commit into
resend:canaryfrom
Btocode:fix/inspector-strikethrough-mark
Open

fix(editor): use 'strike' mark name for inspector strikethrough#3567
Btocode wants to merge 1 commit into
resend:canaryfrom
Btocode:fix/inspector-strikethrough-mark

Conversation

@Btocode

@Btocode Btocode commented Jun 14, 2026

Copy link
Copy Markdown

Fixes #3560

Problem

Clicking Strikethrough in the typography inspector (Inspector.Text → Format row) throws and does nothing:

Uncaught Error: There is no mark type named 'line-through'. Maybe you forgot to add the extension?

The BubbleMenu strikethrough works; only the inspector button is affected.

Root cause

FORMAT_ITEMS in packages/editor/src/ui/inspector/config/text-config.tsx defined the strikethrough entry with the CSS text-decoration value line-through as the mark identifier:

{ value: 'line-through', icon: StrikethroughIcon, label: 'Strikethrough' }

But typography.tsx passes item.value straight into the tiptap command:

onClick={() => toggleMark(item.value)}   // -> editor.chain().focus().toggleMark(mark).run()
aria-pressed={marks[item.value] ?? false}

There is no tiptap mark named line-through, so the toggle throws. The pressed state was also always false, because activeMarks is keyed by MARK_NAMES = ['bold','italic','underline','strike','code'].

Fix

Use the tiptap mark name strike (matching BubbleMenuStrike in ui/bubble-menu/strike.tsx):

{ value: 'strike', icon: StrikethroughIcon, label: 'Strikethrough' }

This fixes both the throw and the pressed-state indicator.

Scope / not changed

  • MARK_TOGGLES keeps line-through — it uses an explicit toggleStrike command and text-block-utils maps from the stored text-decoration value (covered by an existing test).
  • TEXT_DECORATION_ITEMS keeps line-through — those are genuine CSS text-decoration values.

A changeset is included (@react-email/editor patch).


Summary by cubic

Fix the Strikethrough button in the typography inspector in @react-email/editor by using the tiptap mark name strike instead of the CSS value line-through. This removes the runtime error and restores the pressed state.

Written for commit 731aea2. Summary will update on new commits.

Review in cubic

The typography inspector's Format row passes item.value directly into
editor.chain().toggleMark(value), but the Strikethrough entry used the
CSS text-decoration value 'line-through' instead of the tiptap mark
name 'strike'. Clicking it threw "There is no mark type named
'line-through'" and the pressed state never reflected (activeMarks is
keyed by 'strike' via MARK_NAMES). Aligns with BubbleMenuStrike.

Fixes resend#3560
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@Btocode is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 731aea2

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

This PR includes changesets to release 1 package
Name Type
@react-email/editor 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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Fixes a bug in the tiptap editor by correcting a mark name. However, this changes behavior in the core editor UI and involves understanding of internal tiptap extension naming, which is best reviewed by a human to avoid regressions.

Re-trigger cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[editor] Inspector.Text strikethrough throws "There is no mark type named 'line-through'"

1 participant