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

Trim whitespace from URLs #121

Merged
merged 1 commit into from
Jun 7, 2019
Merged

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Jun 3, 2019

  • org-cliplink.el (org-cliplink-clipboard-content): Trim the string.

I assume there is no need to make this configurable since a URL cannot contain whitespace.

I'm ambivalent about whether trimming should be done by org-cliplink-clipboard-content, by org-cliplink-org-mode-link-transformer, or possibly by org-cliplink and org-cliplink-capture. What do you think?

* org-cliplink.el (org-cliplink-clipboard-content): Trim the string.
@Miciah Miciah force-pushed the trim-whitespace-from-URLs branch from 2fab67e to c7f3fad Compare June 3, 2019 23:34
@rexim
Copy link
Owner

rexim commented Jun 7, 2019

  1. org-cliplink-org-mode-link-transformer is done after performing the HTTP request, so if the URL contains any spaces org-cliplink tries to query URL with spaces anyway.
  2. org-cliplink-clipboard-content works well, but trimming whitespaces kinda contradicts the name of the function. But since we already modifying the content with substring-no-property maybe it's ok.

I'll merge it. Thanks for the contribution!

@rexim rexim merged commit fa4d98c into rexim:master Jun 7, 2019
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