Prevent the (old) preprocessor from appending trailing whitespace when removing closing HTML comments

This can currently be seen in the *built* `web/viewer.html` file, at the line containing "  <script src="viewer.js"></script>  ".
This commit is contained in:
Jonas Jenwald 2020-06-11 12:15:18 +02:00
parent c9934de87c
commit 85a67456ed

View File

@ -181,7 +181,7 @@ function preprocess(inFilename, outFilename, defines) {
!stack.includes(STATE_IF_FALSE) &&
!stack.includes(STATE_ELSE_FALSE)
) {
writeLine(line.replace(/^\/\/|^<!--|-->$/g, " "));
writeLine(line.replace(/^\/\/|^<!--/g, " ").replace(/-->$/g, ""));
}
}
}