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(paste-markdown): Escape backslashes before punctuation #866

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

rfgamaral
Copy link
Member

@rfgamaral rfgamaral commented Aug 9, 2024

Overview

This PR addresses an issue where backslashes (\) in pasted content are mistakenly interpreted as escape sequences, leading to the unintended removal of the backslash. This behavior occurs because the source of the pasted content is often unknown, and the backslashes are not properly escaped.

To prevent this, the PR introduces a solution that automatically escapes all backslashes that appear before punctuation marks. This ensures that the backslashes are not misinterpreted as escape characters, preserving the intended content during the paste operation.

This will help with this internal issue.

PR Checklist

Test plan

  • Open the preview Storybook deployed to Netlify
  • Open the Rich-text → Default story
  • Copy the following text: C:\Folder\_FooBar
  • Paste into the editor with Ctrl+Shift+V
    • Observe that the output in Typist Editor is C:\Folder\_FooBar
    • Observe that the output in Markdown Output is C:\Folder\\_FooBar

@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label Aug 9, 2024
@rfgamaral rfgamaral requested a review from a team August 9, 2024 16:40
@rfgamaral rfgamaral self-assigned this Aug 9, 2024
@rfgamaral rfgamaral requested review from pawelgrimm and removed request for a team August 9, 2024 16:40
@rfgamaral rfgamaral enabled auto-merge (squash) August 9, 2024 16:40
Copy link

netlify bot commented Aug 9, 2024

Deploy Preview for doist-typist ready!

Name Link
🔨 Latest commit 4d8c36f
🔍 Latest deploy log https://app.netlify.com/sites/doist-typist/deploys/66b6467db3174000088b9e69
😎 Deploy Preview https://deploy-preview-866--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 merged commit e7e83de into main Aug 9, 2024
9 checks passed
@rfgamaral rfgamaral deleted the ricardo/escape-markdown-on-paste branch August 9, 2024 16:41
doistbot added a commit that referenced this pull request Aug 9, 2024
## [6.0.5](v6.0.4...v6.0.5) (2024-08-09)

### Bug Fixes

* **paste-markdown:** Escape backslashes before punctuation ([#866](#866)) ([e7e83de](e7e83de))
@doistbot
Copy link
Member

doistbot commented Aug 9, 2024

🎉 This PR is included in version 6.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@doistbot doistbot added the released Pull requests that have been released to production label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Pull requests that have been released to production 👀 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.

2 participants