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 Command to remove line breaks & trim selected content #18

Merged
merged 2 commits into from
Mar 14, 2021

Conversation

Oudwins
Copy link
Contributor

@Oudwins Oudwins commented Feb 19, 2021

Hey,

Looks like my formatter did screwed something up, not sure how to avoid that... Anyways, line 62 just trims the selected text and removes all line breaks.

I do a lot of copying from PDFs and line breaks are a real issue. Im thinking this could be extended to removing HTML as well, maybe even markdown.

For those of us that at some point want to remove all formatting from text.

PS: This is my first attempt at contributing so sorry if I messed something up.

@argenos
Copy link
Owner

argenos commented Feb 19, 2021

Hey @Oudwins, thanks for the PR! It's a bit hard to review since the whole file seems to have changes. Do you think you can open a new PR that contains only the changes you introduced? As a side note, are you using the PDF Highlights or PDF to Markdown plugin to extract content from PDFs?

@Oudwins
Copy link
Contributor Author

Oudwins commented Mar 1, 2021

Hello @argenos

Will do, give me a bit more time, been super busy. Those plugins probably won't work since these are highly stylized pdfs that have multiple columns, images, side notes and footers.

@argenos
Copy link
Owner

argenos commented Mar 1, 2021

Don't worry! Take your time!

@Oudwins
Copy link
Contributor Author

Oudwins commented Mar 14, 2021

Wow, it updated this pull request?

Took me a long time. Been very busy (for like 5 lines of code Jesus...) but here it is. Made it to it will also remove HTML (although it uses a pretty simple regex check that wont work for a lot of things actually. Maybe its best to remove that until I can find the time to make a proper html checker.

@Oudwins
Copy link
Contributor Author

Oudwins commented Mar 14, 2021

I went ahead and deleted the regex that removed basic HTML elements. I could consider using something like this https://www.npmjs.com/package/string-strip-html for that functionality.

@argenos argenos merged commit f95aaf6 into argenos:master Mar 14, 2021
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