diff --git a/app/javascript/elements/html_editor.js b/app/javascript/elements/html_editor.js
index 29a5f40e..0c851ee5 100644
--- a/app/javascript/elements/html_editor.js
+++ b/app/javascript/elements/html_editor.js
@@ -353,7 +353,7 @@ function buildExtensions ({ Node, Mark, Extension, Plugin, Decoration, Decoratio
const buildDecorations = (doc) => {
const decorations = []
- const regex = /\{\{?[a-zA-Z0-9_.-]+\}\}?/g
+ const regex = /\{\{?[^{}\n]+\}\}?/g
doc.descendants((node, pos) => {
if (!node.isText) return
diff --git a/app/javascript/elements/markdown_editor.js b/app/javascript/elements/markdown_editor.js
index bd2508a5..9e31737c 100644
--- a/app/javascript/elements/markdown_editor.js
+++ b/app/javascript/elements/markdown_editor.js
@@ -150,7 +150,7 @@ export default actionable(targetable(class extends HTMLElement {
const buildDecorations = (doc) => {
const decorations = []
- const regex = /\{\{?[a-zA-Z0-9_.-]+\}\}?/g
+ const regex = /\{\{?[^{}\n]+\}\}?/g
doc.descendants((node, pos) => {
if (!node.isText) return