-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 inline code formatting for text enclosed in backticks #4468
Fix inline code formatting for text enclosed in backticks #4468
Conversation
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
bcaef5c
to
7e7ae19
Compare
🦋 Changeset detectedLatest commit: 66c8f9b The changes in this PR will be included in the next version bump. This PR includes changesets to release 54 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @marwan37, sorry for the long wait!
Please describe your changes
In the current implementation of the @tiptap/extension-code, the regex pattern does not correctly format text enclosed in backticks when they are immediately preceded or followed by any character other than whitespace.
How did you accomplish your changes
Updated the
inputRegex
andpasteRegex
patterns to the following:The regex uses negative lookbehind and lookahead assertions to ensure that only single backticks are considered for formatting to avoid conflicts with potential code block syntax or other uses of multiple backticks.
How have you tested your changes
Tested in various scenarios to ensure that it correctly formats text as inline code blocks, and that it doesn't conflict with other extensions.
How can we verify your changes
npm run start
and navigate to any playgroundRemarks
This change enhances the flexibility of the inline code formatting.
Checklist
Related issues
#4467
Issue #338 in BlockNote - Original issue where the bug was identified and discussed.