Skip to content

Commit

Permalink
fix inclusion of comments in jupyterlab-sosk JS code, too bad we cann…
Browse files Browse the repository at this point in the history
…ot yet test JS code. vatlab/sos#976
  • Loading branch information
Bo Peng committed Jun 16, 2018
1 parent 1d3c001 commit 0510666
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ function getCellWorkflow(cell: ICellModel) {
} else if (lines[l].startsWith("#") || lines[l].startsWith("%") || lines[l].trim() === "" || lines[l].startsWith("!")) {
continue;
} else if (lines[l].startsWith("[") && lines[l].endsWith("]")) {
workflow += lines.slice(l).join("\n") + "\n\n";
// include comments before section header
let c = l - 1
let comment = ''
while (c >= 0 && lines[c].startsWith('#')) {
comment = lines[c] + '\n' + comment;
c -= 1;
}
workflow += comment + lines.slice(l).join("\n") + "\n\n";
break;
}
}
Expand Down

0 comments on commit 0510666

Please sign in to comment.