From a869633d85f363bbbd90b2341954960d8d98eb71 Mon Sep 17 00:00:00 2001 From: Kirill-Hatalski Date: Wed, 12 Jun 2024 15:25:48 +0300 Subject: [PATCH 1/2] fix: removing hb special symbols around placeholder --- src/qtiItem/core/Container.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qtiItem/core/Container.js b/src/qtiItem/core/Container.js index 9e3560b7..cd5ee4b7 100644 --- a/src/qtiItem/core/Container.js +++ b/src/qtiItem/core/Container.js @@ -127,7 +127,10 @@ var Container = Element.extend({ //@todo : container rendering merging, to be tested tpl = tpl.replace(elt.placeholder(), elt.render(renderer)); } else { - tpl = tpl.replace(elt.placeholder(), '{{{' + serial + '}}}'); + tpl = tpl + .replace(elt.placeholder(), serial) + .replace('{', '{') + .replace(serial, '{{{' + serial + '}}}'); elementsData[serial] = elt.render(renderer); } } else { From 460d8f5f34ac49d4747289b628abaa4fa6bd4e19 Mon Sep 17 00:00:00 2001 From: Kirill-Hatalski Date: Thu, 13 Jun 2024 15:31:20 +0300 Subject: [PATCH 2/2] fix: after review fixes --- src/qtiItem/core/Container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qtiItem/core/Container.js b/src/qtiItem/core/Container.js index cd5ee4b7..baf13f6b 100644 --- a/src/qtiItem/core/Container.js +++ b/src/qtiItem/core/Container.js @@ -129,7 +129,7 @@ var Container = Element.extend({ } else { tpl = tpl .replace(elt.placeholder(), serial) - .replace('{', '{') + .replace(new RegExp(`{${serial}`), `{${serial}`) .replace(serial, '{{{' + serial + '}}}'); elementsData[serial] = elt.render(renderer); }