Skip to content

Commit 81f2649

Browse files
committed
array of hints
1 parent 8086c61 commit 81f2649

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coderoad-cli",
3-
"version": "0.3.13",
3+
"version": "0.3.14",
44
"description": "Command line interface for CodeRoad. Build project files.",
55
"keywords": [
66
"coderoad"
@@ -20,7 +20,7 @@
2020
"dependencies": {
2121
"chalk": "1.1.1",
2222
"commander": "2.9.0",
23-
"lodash": "4.5.0",
23+
"lodash": "4.5.1",
2424
"prompt": "1.0.0"
2525
},
2626
"devDependencies": {

src/build/parser/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function doAction(type, isArray, actionValue, result, line, index) {
1717
if (!!isArray) {
1818
var valueList = actionValue.slice(1, -1).split(',');
1919
valueList.forEach(function (value) {
20-
var value = cleanup_1.trimQuotes(value.trim());
20+
var value = cleanup_1.trimQuotes(value.trim(), true);
2121
result.chapters[index.chapter].pages[index.page].tasks[index.task][type].push(value);
2222
});
2323
}

src/build/parser/cleanup.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@ function trimLineBreaks(text) {
66
return text;
77
}
88
exports.trimLineBreaks = trimLineBreaks;
9-
var quotes = ['\'', '"', '`'];
10-
function trimQuotes(text) {
9+
var quotes = ['\'', '"'];
10+
function trimQuotes(text, quotesOnly) {
1111
if (!!text.match(/^[\r\n]/)) {
1212
return text;
1313
}
1414
else if (!!text.match(/^\s/)) {
15-
return trimQuotes(text.slice(1));
15+
return trimQuotes(text.slice(1), quotesOnly);
1616
}
1717
else if (!!text.match(/\s$/)) {
18-
return trimQuotes(text.slice(0, text.length - 1));
18+
return trimQuotes(text.slice(0, text.length - 1), quotesOnly);
1919
}
20-
else if (!!text.match(/^`{3}.+`{3}$/m)) {
21-
return trimQuotes(text.slice(3, text.length - 3));
20+
else if (quotes.indexOf(text.charAt(0)) > -1 &&
21+
quotes.indexOf(text.charAt(text.length - 1)) > -1) {
22+
return trimQuotes(text.slice(1, text.length - 1), quotesOnly);
2223
}
23-
else if (quotes.indexOf(text.charAt(0)) > -1 && quotes.indexOf(text.charAt(text.length - 1)) > -1) {
24-
return trimQuotes(text.slice(1, text.length - 1));
24+
else if (!quotesOnly &&
25+
!!text.match(/^`{3}.+`{3}$/m)) {
26+
return trimQuotes(text.slice(3, text.length - 3), quotesOnly);
27+
}
28+
else if (!quotesOnly &&
29+
text.charAt(0) === '`' &&
30+
text.charAt(text.length - 1) === '`') {
31+
return trimQuotes(text.slice(1, text.length - 1), quotesOnly);
2532
}
2633
else {
2734
return text;

src/create/setup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"node" : ">=0.10.3"
1515
},
1616
"dependencies": {
17-
"mocha-coderoad": "^0.3.1"
17+
"mocha-coderoad": "^0.4.2"
1818
},
1919
"license": "MIT",
2020
"config": {

0 commit comments

Comments
 (0)