Conversation
🦋 Changeset detectedLatest commit: 8521ecb The changes in this PR will be included in the next version bump. This PR includes changesets to release 72 packages
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 |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Fixes a Twitch embed round-trip issue in @tiptap/extension-twitch where the original Twitch URL (video/clip/channel) could be lost when content is rendered to HTML and then parsed back into the editor.
Changes:
- Added a utility to reverse-parse Twitch embed URLs back into canonical node attributes (
src, plus relevant params). - Updated the Twitch node’s
addAttributes().parseHTMLhandling to restore canonicalsrc(and parse width/height/autoplay/muted/time from HTML). - Added a regression test to verify
srcis preserved across HTML round-trips, plus a changeset entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/extension-twitch/src/utils.ts | Adds getAttributesFromTwitchEmbedUrl to convert embed URLs back into canonical Twitch node attrs. |
| packages/extension-twitch/src/twitch.ts | Wires new parsing into parseHTML for node attributes so HTML re-import preserves canonical src. |
| packages/extension-twitch/tests/twitch.spec.ts | Adds round-trip regression test ensuring src survives HTML export/import. |
| .changeset/green-stingrays-shop.md | Adds a patch changeset describing the user-facing fix. |
…d add regressions
| return { | ||
| src: { | ||
| default: null, | ||
| parseHTML: element => getParsedTwitchAttributes(element as HTMLElement)?.src, |
There was a problem hiding this comment.
Is the casting (as operator) always valid here? Or could there be a situation where the element is not an HTML element?
|
Should we do the same in the YouTube extension? |
Changes Overview
Implementation Approach
packages/extension-twitch/src/utils.tsand wiredparseHTMLattribute parsing for the Twitch node inpackages/extension-twitch/src/twitch.ts.packages/extension-twitch/__tests__/twitch.spec.ts.Testing Done
Verification Steps
Additional Notes
.changeset/green-stingrays-shop.mdwith a short user-facing note. No public API changes were made.Checklist
pnpm lintif needed).Related Issues