Skip to content

Move outside links before breaking at their end - #6202

Merged
dylans merged 1 commit into
mainfrom
inlines-break-link
Oct 10, 2026
Merged

dylans merged 1 commit into
mainfrom
inlines-break-link

Conversation

@dylans

@dylans dylans commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Pressing Enter with a collapsed caret inside the end of a link duplicated an empty link into the next paragraph. Move that caret to the following text node before the example's normal insertBreak runs.

Fixes #4334

Case Before After
Enter inside the end of a link Empty link in the next paragraph Next paragraph starts outside the link
Enter inside the middle of a link Splits the link Unchanged
Enter with part of the link selected Replaces the selection and splits the link Unchanged

Regenerate only the matching JSX. This example-only fix needs no changeset. The override targets link nodes only and delegates the actual paragraph split to the existing handler.

Validation: the link-end regression fails on main 8f59fd3 in Chromium, Firefox and WebKit; the two consequence cases pass on main. All three cases pass twice with the fix in each desktop browser (18 passed / 6 synthetic-mobile cases skipped).

check.sh passed on Node 24.21.0: 1,468 Mocha / 141 Jest tests, build, TypeScript, ESLint and Prettier. Playwright TypeScript also passes.

Full browser suite: 271 passed / 20 skipped / one Chromium Markdown list failure, also reproduced on main 8f59fd3 (2 failures / 10 passes across four Markdown-test repeats). All new link tests pass. The markdown-shortcuts failure is a test-timing flake (a click processed after the keys that follow it), fixed separately in #6205.

@changeset-bot

changeset-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d91b9d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@dylans
dylans merged commit 1351ea2 into main Oct 10, 2026
16 checks passed
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.

If you press enter after link next paragraph will contain link with empty text.

1 participant