Skip to content

Externalize format-library to fix missing link button#97

Merged
kraftbj merged 1 commit intotrunkfrom
review-issue-95
Mar 16, 2026
Merged

Externalize format-library to fix missing link button#97
kraftbj merged 1 commit intotrunkfrom
review-issue-95

Conversation

@kraftbj
Copy link
Copy Markdown
Collaborator

@kraftbj kraftbj commented Mar 16, 2026

Summary

  • Adds @wordpress/format-library to the webpack externals map so it shares the same global wp.richText format registry as the externalized @wordpress/block-editor
  • Without this, the format-library's format types (bold, italic, link) were registered in a private bundled registry that the block editor toolbar never read from, so the link button was missing

Test plan

  • Open Press This editor
  • Select text in a paragraph block
  • Verify the link button appears in the fixed toolbar
  • Click the link button (or use Cmd/Ctrl+K) and confirm the link popover opens
  • Add a link and verify it is saved correctly

Fixes #95

Without externalization, the format-library registers format types
(bold, italic, link) in a bundled copy of the rich-text registry,
while the externalized block-editor reads from the global registry.
This mismatch caused the link button to be missing from the toolbar.

See #95
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the missing “link” (and other rich text format) toolbar buttons in the Press This editor by ensuring @wordpress/format-library uses WordPress core’s shared wp.richText format registry (instead of a bundled private registry).

Changes:

  • Externalizes @wordpress/format-library in the custom webpack externals map so it resolves to the core global wp.formatLibrary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kraftbj kraftbj added this to the 2.0.2 milestone Mar 16, 2026
@kraftbj kraftbj merged commit 21a9955 into trunk Mar 16, 2026
10 checks passed
@kraftbj kraftbj self-assigned this Mar 16, 2026
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.

Unable to add links

2 participants