sindresorhus/opn

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Fix cannot open url contains `|` on windows #98

baoti posted onGitHub

  • If contains space, DO NOT escape;
  • otherwise, DO escape.
  • No matter target is URL, or file path.
  • Escape Character: & \ < > ^ |

Detail in #74 (comment).


Alright, let's try out this then:

If contains space, DO NOT escape;
otherwise, DO escape.
posted by sindresorhus almost 6 years ago

@baoti Can you fix the merge conflict?

posted by sindresorhus almost 6 years ago

@sindresorhus I got the reason for doing not escape which contains space char. The argument would be wrapped in double quotes. See source for detail.

We can pass childProcessOptions.windowsVerbatimArguments = true to disable it, and always escape target by double quotes.

posted by baoti almost 6 years ago

Good find. Let’s do that then.

posted by sindresorhus almost 6 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests