diff --git a/lib/util/interpolate.js b/lib/util/interpolate.js index e0f2d027d197..d02f0933aea7 100644 --- a/lib/util/interpolate.js +++ b/lib/util/interpolate.js @@ -13,7 +13,12 @@ module.exports = (text, data) => { if (!data) { return text; } - return text.replace(/\{\{\s*([^{}]+?)\s*\}\}/g, (fullMatch, term) => { + + // Substitution content for any {{ }} markers. + return text.replace(/\{\{([^{}]+?)\}\}/g, (fullMatch, term) => { + + // Strip leading and trailing whitespace. + term = term.replace(/^\s+|\s+$/g, ""); if (term in data) { return data[term]; }