diff --git a/core/util/engineTools.js b/core/util/engineTools.js index c07d7c10..5d6cea3d 100644 --- a/core/util/engineTools.js +++ b/core/util/engineTools.js @@ -51,7 +51,9 @@ function getSelectorName (selector) { } function makeSafe (str) { - return str.replace(/[ /]/g, '_'); + return str + .replace(/[^a-z0-9_-]/gi, (match) => encodeURIComponent(match)) + .replace(/[ /]/g, '_'); } function getFilename (fileNameTemplate, outputFileFormatSuffix, configId, scenarioIndex, scenarioLabelSafe, selectorIndex, selectorLabel, viewportIndex, viewportLabel) {