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

Vorpal adding quotes to string #7

Open
huan opened this issue Jul 2, 2020 · 0 comments
Open

Vorpal adding quotes to string #7

huan opened this issue Jul 2, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@huan
Copy link
Member

huan commented Jul 2, 2020

lib/util.js:

-       const reg = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g;	
-       passedArgs = passedArgs.replace(reg, `"$2='$4$5'"`);	
+       const reg = /(?<=[-\s]\b)(\w+)=(["']\b)((?:(?=(\\?))\3.)*?)(?=\2)\2/g;
+       passedArgs = passedArgs.replace(reg, `"$1='$3'"`);

See:

  1. How can I stop vorpal from adding quotes to string ?  dthree/vorpal#307
  2. Normalization regex fix dthree/vorpal#321
@huan huan added the bug Something isn't working label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant