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 InputRule regex matcher ignoring non-text leaflets in textBefore #2807

Merged
merged 4 commits into from May 20, 2022

Conversation

bdbch
Copy link
Contributor

@bdbch bdbch commented May 19, 2022

This PR should fix #2806

Currently non-text leaflets (which for example the Mention example is) this matcher is inserting space ( ) which would fit into the regex of the extension regex match strings.

I added a placeholder for this check resulting in non-text leafs being replaced with %leaf% which will stop those regex from returning true when a non-text leaf is used in front.

Since this function is not used for anything else but this check I think it's okay to use this %leaf% placeholder but I'm open for feedback or ideas how to solve this differently.

@netlify
Copy link

netlify bot commented May 19, 2022

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit f554197
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/6287bc1d2685f300098af778
😎 Deploy Preview https://deploy-preview-2807--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 site settings.

@bdbch bdbch requested a review from svenadlung May 19, 2022 20:44
@bdbch bdbch self-assigned this May 19, 2022
@bdbch
Copy link
Contributor Author

bdbch commented May 20, 2022

I forced push a different solution proposed by @rfgamaral in #2806 (thanks!).

We now include the textContent of non-text leafs & fallback to a %leaf% placeholder when no renderText function is provided.

@bdbch bdbch merged commit ecee74a into main May 20, 2022
@bdbch bdbch deleted the bdbch/issue2806 branch May 20, 2022 17:04
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.

Block level markdown shortcuts removes previous mention nodes
2 participants