From 32b0816ecbad635160d60ab9d1d7b9e26358aea5 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 3 Feb 2021 11:41:33 +0000 Subject: [PATCH] Quick fix for string-templates, was being a bit too fuzzy in its lookup of possible helper names. --- packages/string-templates/src/index.js | 4 +++- packages/string-templates/src/processors/preprocessor.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/string-templates/src/index.js b/packages/string-templates/src/index.js index 9cedcde061..6992eb839e 100644 --- a/packages/string-templates/src/index.js +++ b/packages/string-templates/src/index.js @@ -91,7 +91,9 @@ module.exports.processStringSync = (string, context) => { } string = processors.preprocess(string) // this does not throw an error when template can't be fulfilled, have to try correct beforehand - const template = hbsInstance.compile(string) + const template = hbsInstance.compile(string, { + strict: false, + }) return processors.postprocess(template(clonedContext)) } diff --git a/packages/string-templates/src/processors/preprocessor.js b/packages/string-templates/src/processors/preprocessor.js index af6d656eaa..ee3a3a9730 100644 --- a/packages/string-templates/src/processors/preprocessor.js +++ b/packages/string-templates/src/processors/preprocessor.js @@ -63,7 +63,7 @@ module.exports.processors = [ return statement } } - if (HelperNames().some(option => possibleHelper.includes(option))) { + if (HelperNames().some(option => option.includes(possibleHelper))) { insideStatement = `(${insideStatement})` } return `{{ all ${insideStatement} }}`