Skip to content

Commit 53827f2

Browse files
committed
Make tools handle sandbox attributes in source
1 parent 5c6ba63 commit 53827f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bin/build_code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var fs = require("fs");
33
var file = process.argv[2];
44
var input = fs.readFileSync(file, "utf8");
55

6-
var included = /\/\/ include_code(.*)\n(?:\/\/.*\n)*\s*\[source,javascript\]\n----\n([\s\S]*?\n)----/g, m;
6+
var included = /\/\/ include_code(.*)\n(?:\/\/.*\n)*\s*(?:\[sandbox=.*\n)?\[source,javascript\]\n----\n([\s\S]*?\n)----/g, m;
77
var code = [];
88
while (m = included.exec(input)) {
99
var snippet = m[2], directive = m[1];

bin/run_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function pos(index) {
3636
return "line " + (input.slice(0, index).split("\n").length + 1);
3737
}
3838

39-
var re = /((?:\/\/.*\n|\s)*)\[source,javascript\]\n----\n([\s\S]*?\n)----/g, m;
39+
var re = /((?:\/\/.*\n|\s)*)(?:[sandbox=.*\n)?\[source,javascript\]\n----\n([\s\S]*?\n)----/g, m;
4040
while (m = re.exec(input)) {
4141
var snippet = m[2], hasConf = m[1].match(/\/\/ test: (.*)/), config = hasConf ? hasConf[1] : "";
4242
var where = pos(m.index);

0 commit comments

Comments
 (0)