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

Removed extra spaces after marks #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OnkelTem
Copy link

@OnkelTem OnkelTem commented Jun 10, 2022

To resolve this: #39

First, if I'm not mistaking the entire block:

 (selectedText && sufFirst === " ") ||
        (!selectedText && sufFirst === " ")
          ? editor.replaceSelection(`${prefix}${selectedText}${suffix}`)
          : selectedText && sufFirst !== " "
          ? editor.replaceSelection(`${prefix}${selectedText}${suffix} `)
          : editor.replaceSelection(`${prefix}${selectedText}${suffix} `);

is equivalent to:

editor.replaceSelection(`${prefix}${selectedText}${suffix}${sufFirst !== " " ? " " : ""}`)

Thus, the idea was to add a whitespece if the selection doesn't have another one aftewards.
And if I select a word in word. I get [word ]. selected.
I don't think it's correct behavior and so I dared to change it.

@chetachiezikeuzor
Copy link
Owner

Firstly, thank you so much for contributing. I apologize for neglecting this plugin, as I've been dealing with family issues for the past few months. Looking at this now, I'm not sure why I added the extra space. I do think this looks great, and much cleaner as well! I'll test later today and hopefully release a version before tomorrow. Thanks again!

@OnkelTem
Copy link
Author

Sure, n/p!

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

Successfully merging this pull request may close these issues.

2 participants