diff --git a/lib/formater.js b/lib/formater.js index dbe21c2..0437f9d 100644 --- a/lib/formater.js +++ b/lib/formater.js @@ -7,7 +7,7 @@ * @returns string */ function renderTemplate(templateString, data) { - return templateString.replace(/{(.*?)}/g, function (_, key) { + return templateString.replace(/{\s*(\w+)\s*}/g, function (_, key) { if (data && data[key] !== undefined) { return data[key]; } diff --git a/package-lock.json b/package-lock.json index 3696597..cb6cdab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "staticrypt", - "version": "2.3.3", + "version": "2.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "staticrypt", - "version": "2.3.3", + "version": "2.3.4", "license": "MIT", "dependencies": { "crypto-js": "3.1.9-1", diff --git a/package.json b/package.json index ac10770..b822278 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "staticrypt", - "version": "2.3.3", + "version": "2.3.4", "description": "Based on the [crypto-js](https://github.com/brix/crypto-js) library, StatiCrypt uses AES-256 to encrypt your input with your passphrase and put it in a HTML file with a password prompt that can decrypted in-browser (client side).", "main": "index.js", "files": [