2
0

🐛 (editor) Show variable highlight only when strictly equal

This commit is contained in:
Baptiste Arnaud
2023-01-16 08:03:26 +01:00
parent 65c35faedd
commit dbe5c3cdb1

View File

@ -49,7 +49,7 @@ export const blockHasOptions = (block: Block) => 'options' in block
export const parseVariableHighlight = (content: string, typebot: Typebot) => {
const varNames = typebot.variables.map((v) => v.name)
return content.replace(/\{\{(.*?)\}\}/g, (fullMatch, foundVar) => {
if (varNames.some((val) => foundVar.includes(val))) {
if (varNames.some((val) => foundVar === val)) {
return `<span style="background-color:#ff8b1a; color:#ffffff; padding: 0.125rem 0.25rem; border-radius: 0.35rem">${fullMatch.replace(
/{{|}}/g,
''