|
@@ -25,13 +25,15 @@ ko.bindingHandlers.parseArguments = {
|
|
|
const bits = [];
|
|
const bits = [];
|
|
|
let isInQuotes = false;
|
|
let isInQuotes = false;
|
|
|
let tempStr = '';
|
|
let tempStr = '';
|
|
|
|
|
+ let charQuote = null;
|
|
|
str
|
|
str
|
|
|
.replace(/<\/?arg>|<\/?command>/gi, ' ')
|
|
.replace(/<\/?arg>|<\/?command>/gi, ' ')
|
|
|
.replace(/\r?\n|\r/g, '')
|
|
.replace(/\r?\n|\r/g, '')
|
|
|
.replace(/\s\s+/g, ' ')
|
|
.replace(/\s\s+/g, ' ')
|
|
|
.split('')
|
|
.split('')
|
|
|
.forEach(char => {
|
|
.forEach(char => {
|
|
|
- if (char === '"' || char === "'") {
|
|
|
|
|
|
|
+ if ((char === '"' || char === "'") && (!charQuote || charQuote == char)) {
|
|
|
|
|
+ charQuote = isInQuotes ? null : char;
|
|
|
isInQuotes = !isInQuotes;
|
|
isInQuotes = !isInQuotes;
|
|
|
} else if ((char === ' ' || char === '\n') && !isInQuotes && tempStr !== '') {
|
|
} else if ((char === ' ' || char === '\n') && !isInQuotes && tempStr !== '') {
|
|
|
bits.push(tempStr);
|
|
bits.push(tempStr);
|