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(bold-and-italics): Disallow only whitespace in the markdown shortcuts #651

Merged
merged 1 commit into from Feb 8, 2024

Conversation

rfgamaral
Copy link
Member

@rfgamaral rfgamaral commented Feb 8, 2024

Overview

This PR disallows Markdown shortcuts (through typing or pasting) for the BoldAndItalics mark when the content between the delimiters is only whitespace. This brings the same RegExp as implemented in this Tiptap PR for all the built-in marks.

PR Checklist

Test plan

  • Open the preview Storybook deployed to Netlify
  • Open the Rich-text → Default story
    • Observe that you can use ***<text>*** and ___<text>___ as before to have <text> both bold and italic
    • Observe that using ***<whitespace>*** or ___<whitespace>___ doesn't do anything

Tip

When typing ***<space> (or ___<space>), an horizontal break will appear in the editor. Just press Backspace once to undo that transformation, and then you are able to continue typing more whitespace or the ending delimiter *** (or ___).

Demo

firefox_nxNAhDTJUr

firefox_lwS4OvqOlS

@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label Feb 8, 2024
@rfgamaral rfgamaral requested a review from a team February 8, 2024 16:00
@rfgamaral rfgamaral self-assigned this Feb 8, 2024
@rfgamaral rfgamaral requested review from pedroalves0 and removed request for a team February 8, 2024 16:00
Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for doist-typist ready!

Name Link
🔨 Latest commit b97ac40
🔍 Latest deploy log https://app.netlify.com/sites/doist-typist/deploys/65c4fb03c0e20d00099f77fa
😎 Deploy Preview https://deploy-preview-651--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) February 8, 2024 16:01
@rfgamaral rfgamaral force-pushed the ricardo/better-bold-and-italics-regex branch from f6b3a4c to b97ac40 Compare February 8, 2024 16:02
@rfgamaral rfgamaral changed the title fix:(bold-and-italics): Disallow only whitespace in the markdown shortcuts fix(bold-and-italics): Disallow only whitespace in the markdown shortcuts Feb 8, 2024
@rfgamaral rfgamaral merged commit df9d557 into main Feb 8, 2024
10 checks passed
@rfgamaral rfgamaral deleted the ricardo/better-bold-and-italics-regex branch February 8, 2024 16:06
doistbot added a commit that referenced this pull request Feb 8, 2024
## [4.0.2](v4.0.1...v4.0.2) (2024-02-08)

### Bug Fixes

* **bold-and-italics:** Disallow only whitespace in the markdown shortcuts ([#651](#651)) ([4c740dd](4c740dd))
@pedroalves0
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 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.

None yet

2 participants