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(autoformatting): prevent autoformatting when the first underscore is preceded by a non-whitespace character #262

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

giamir
Copy link
Contributor

@giamir giamir commented Jan 25, 2024

STACKS-520

This PR is fixing an issue where Underscore Emphasis Autoformatting was triggered incorrectly.
See the how to test section for more context.

The solution is leveraging a negative lookahead operator to make sure the first underscore is NOT preceded by a non-whitespace character.

How to test

  • Open the editor instance in rich text mode
  • Type manually (not copy pasting) text_text_ (or text__text__)
  • Observe auto formatting NOT kicking in and rewriting the above to texttext (or texttext)

@giamir giamir added bug Something isn't working mode - rich text Affects the editor's rich text (wysiwyg) mode labels Jan 25, 2024
@giamir giamir requested review from a team and dancormier January 25, 2024 16:43
Copy link

netlify bot commented Jan 25, 2024

Deploy Preview for stacks-editor ready!

Name Link
🔨 Latest commit 31d00a7
🔍 Latest deploy log https://app.netlify.com/sites/stacks-editor/deploys/65b2a3171cf89c000894b142
😎 Deploy Preview https://deploy-preview-262--stacks-editor.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.

@giamir giamir merged commit 5e45ac2 into main Jan 30, 2024
4 checks passed
@giamir giamir deleted the STACKS-520/fix-underscore-emphasis-autoformatting branch January 30, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mode - rich text Affects the editor's rich text (wysiwyg) mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants