Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rich-text-link): Markdown pasting broken with conflicting linkOnPaste option #411

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

rfgamaral
Copy link
Member

@rfgamaral rfgamaral commented Aug 28, 2023

Overview

With the latest Tiptap version (#407), the Link extension came with a new built-in linkOnPaste option (default: true), which conflicted with our own paste rules with support for Markdown syntax (in the RichTextLink extension), and our own PasteMarkdown extension with full support for Markdown pasting.

This PR simply forces linkOnPaste to be false, and disallows the option from being set to true in consumer apps. This is a workaround, as I believe this linkOnPaste option is not working as expected, and made an upstream comment about it here. If this is eventually fixed/improved in Tiptap, we can probably revert this change.

Making this a show PR so that I can push a quick fix to Todoist and Twist (we already started receiving reports about this).

PR Checklist

Test plan

  • Open the preview Storybook deployed to Netlify
  • Open the Rich-text → Default story
  • Copy the following content: [Doist](https://doist.dev)
  • Paste it into the editor with Ctrl + Shift + V (or the macOS equivalent)
    • Observe that the editor will show the word "Doist" linked to https://doist.dev (visible in the "Markdown Output" section on the right side)

Demo

Before After
firefox_CCo2mcZvxQ firefox_vS3HwJATeQ

@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label Aug 28, 2023
@rfgamaral rfgamaral requested a review from a team August 28, 2023 16:20
@rfgamaral rfgamaral self-assigned this Aug 28, 2023
@rfgamaral rfgamaral requested review from pedroalves0 and removed request for a team August 28, 2023 16:20
@netlify
Copy link

netlify bot commented Aug 28, 2023

Deploy Preview for doist-typist ready!

Name Link
🔨 Latest commit b6f2ca4
🔍 Latest deploy log https://app.netlify.com/sites/doist-typist/deploys/64ecc93d63839100081928c0
😎 Deploy Preview https://deploy-preview-411--doist-typist.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 site configuration.

@rfgamaral rfgamaral enabled auto-merge (squash) August 28, 2023 16:20
@rfgamaral rfgamaral merged commit 2df2ba9 into main Aug 28, 2023
@rfgamaral rfgamaral deleted the ricardo/fix-link-markdown-pasting branch August 28, 2023 16:22
doistbot added a commit that referenced this pull request Aug 28, 2023
## [1.4.8](v1.4.7...v1.4.8) (2023-08-28)

### Bug Fixes

* **rich-text-link:** Markdown pasting broken with conflicting `linkOnPaste` option ([#411](#411)) ([2df2ba9](2df2ba9))
@doistbot
Copy link
Member

🎉 This PR is included in version 1.4.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@doistbot doistbot added the released Pull requests that have been released to production label Aug 28, 2023
Copy link
Member

@pedroalves0 pedroalves0 left a comment

Choose a reason for hiding this comment

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

👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Pull requests that have been released to production 👀 Show PR Used for PRs that need a review, but can be merged when CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants