From a7a8f3a6ef8e34ae6fbc2e66ff26c869620e9def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Argentina=20Ortega=20S=C3=A1inz?= Date: Sun, 11 Apr 2021 22:46:48 +0200 Subject: [PATCH] Fix creation of standalone notes w/ custom placeholders Fixes #83 --- content/mdnotes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/mdnotes.js b/content/mdnotes.js index 87b3216..747c547 100644 --- a/content/mdnotes.js +++ b/content/mdnotes.js @@ -555,6 +555,9 @@ function get_placeholder_contents(template, fields) { const re = /{{(\w+)}}/g; let placeholders = template.match(re); + // In case a template doesn't have any placeholders + if (!placeholders) return; + // Loop through all the placeholders for (const result of placeholders) { let placeholder = result.substring(2, result.length - 2)