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: Disallow only whitespace between markdown shortcuts delimiters #4866

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

rfgamaral
Copy link
Contributor

@rfgamaral rfgamaral commented Feb 7, 2024

Please describe your changes

This PR disallows Markdown shortcuts (through typing or pasting) for all marks (Bold, Code, Highlight, Italic, and Strike) when the content between the delimiters is only whitespace.

How did you accomplish your changes

Changed the input and paste Regex for all the marks mentioned above to keep supporting as much as possible from the current syntax, while only disallowing "empty strings" between the delimiters for the Markdown shortcuts of each mark.

Note

The regular expression for all marks follows the exact same pattern, the only difference being the delimiter characters for each mark.

How have you tested your changes

I've used both regex101.com:

firefox_wzo9ORdntq

And the marks demos to test multiple patterns, here's an example for the Highlight extension:

NVIDIA_Share_RoSfI1pELP

How can we verify your changes

The same way I did above.

Copy link

netlify bot commented Feb 7, 2024

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit b1882e9
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/65c4b88b4fb4a10008d457ce
😎 Deploy Preview https://deploy-preview-4866--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 configuration.

@rfgamaral rfgamaral force-pushed the ricardo/better-marks-regexs branch 3 times, most recently from aea5f6e to 120dffb Compare February 8, 2024 10:46
Copy link
Contributor

@bdbch bdbch left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants