Settings.js: support newlines in default values when using variable substitution

This allows, among other things, to correctly support the configuration of
defaultPadText in Docker via an environment variable.
This commit is contained in:
Paul Tiedtke 2020-03-27 06:33:39 +01:00 committed by muxator
parent 3872690715
commit 79406051fa
4 changed files with 11 additions and 2 deletions

View file

@ -474,7 +474,7 @@ function lookupEnvironmentVariables(obj) {
* "${ENV_VAR}" or "${ENV_VAR:default_value}")
*/
// MUXATOR 2019-03-21: we could use named capture groups here once we migrate to nodejs v10
const match = value.match(/^\$\{([^:]*)(:(.*))?\}$/);
const match = value.match(/^\$\{([^:]*)(:((.|\n)*))?\}$/);
if (match === null) {
// no match: use the value literally, without any substitution