ignore shebang

This commit is contained in:
Paul
2021-08-02 13:51:43 +02:00
committed by Maas Lalani
parent ad7fc7871c
commit caa98c45fd

View File

@@ -164,9 +164,15 @@ func readFile(path string) (string, error) {
}
content := string(b)
// Pre-process slides if the file is executable to avoid
// unintentional code execution when presenting slides
if file.IsExecutable(s) {
// Remove shebang if file has one
if strings.HasPrefix(content, "#!") {
content = strings.Join(strings.SplitN(content, "\n", 2)[1:], "\n")
}
content = process.Pre(content)
}