Commit d87b3455 authored by chriseth's avatar chriseth Committed by GitHub

Merge pull request #70 from redsquirrel/import-dot-slash-fix

Safer handling of imports with leading ./
parents 63ac2864 c2047b3b
...@@ -203,7 +203,11 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles ...@@ -203,7 +203,11 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
for (var fileName in files) { for (var fileName in files) {
var match; var match;
while ((match = importRegex.exec(files[fileName]))) { while ((match = importRegex.exec(files[fileName]))) {
importHints.push(match[1]); var importFilePath = match[1];
if (importFilePath.startsWith('./')) {
importFilePath = importFilePath.slice(2);
}
importHints.push(importFilePath);
} }
} }
while (importHints.length > 0) { while (importHints.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment