tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

Fix autolink inside shadow dom

Open sasunstepanyan777 opened this issue 5 months ago • 2 comments

Changes Overview

Enhanced link detection and sanitization to be more robust and Unicode-compliant, especially within shadow DOM contexts.

Implementation Approach

  • Improved how whitespace is handled when detecting and processing autolinks, especially to support the shadow DOM case.
  • Added a new helper file (whitespace.ts) that defines Unicode whitespace regular expressions, based on DOMPurify's implementation.
  • Updated autolink.ts to use these new Unicode-aware whitespace checks, replacing previous plain space checks and logic.
  • Updated link.ts to use the new Unicode whitespace regex for sanitizing URIs, replacing the previous hardcoded regex.

Testing Done

Manual

Verification Steps

Place Editor inside shadow dom

Additional Notes

Checklist

  • [ ] I have created a changeset for this PR if necessary.
  • [x] My changes do not break the library.
  • [ ] I have added tests where applicable.
  • [x] I have followed the project guidelines.
  • [ ] I have fixed any lint issues.

Related Issues

Fixes #6439

sasunstepanyan777 avatar Jun 14 '25 22:06 sasunstepanyan777

Deploy Preview for tiptap-embed ready!

Name Link
Latest commit 473ba2e13caba6f53b5def0be4f31c045af7fcfd
Latest deploy log https://app.netlify.com/projects/tiptap-embed/deploys/6856d5da2095c90008287316
Deploy Preview https://deploy-preview-6449--tiptap-embed.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 14 '25 22:06 netlify[bot]

⚠️ No Changeset found

Latest commit: 473ba2e13caba6f53b5def0be4f31c045af7fcfd

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

changeset-bot[bot] avatar Jun 14 '25 22:06 changeset-bot[bot]