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

Add support for Remove Force Hyphens command #15

Closed
Sinled opened this issue Jan 29, 2022 · 2 comments
Closed

Add support for Remove Force Hyphens command #15

Sinled opened this issue Jan 29, 2022 · 2 comments

Comments

@Sinled
Copy link

Sinled commented Jan 29, 2022

Hi, thanks for great plugin.

Would it be possible to add new command for removing hyphens? I often have hyphens where should be non when copying text from pdfs, something like this:

Lorem Ipsum  is si- mply dummy text of the printing and types- etting industry. Lorem Ipsum has been the industry's st...

usually i replace it in another text editor with regxep /(\w)-[ ]/ but it's not very convenient, and obsidian command will be more useful.

Benature added a commit that referenced this issue Jan 29, 2022
@Benature
Copy link
Owner

supported in v1.5.3

@goncharovdk
Copy link

Hi. There's an issue in the current implementation of this feature.

case "hyphen":
        replacedText = selectedText.replace(/(\w)-[ ]/g, "");

It should replace with "$1", not with an empty string. Otherwise, the character before the hyphen is lost. Using the example from the original comment:

> "si- mply".replace(/(\w)-[ ]/g, "$1")
'simply'
> "si- mply".replace(/(\w)-[ ]/g, "")
'smply'

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

No branches or pull requests

3 participants