decluttering-card
decluttering-card copied to clipboard
Update deep-replace.ts to match single quotes and double quotes
if you want to replace something within a jinja code it is best to set the value in single quotes not in double qoutes. if you have the following template:
decluttering_templates:
my_first_template:
default:
- entities:
- light.outdoor
- light.indoor
card:
content: |
{{ "[[entities]]' }}"
type: markdown
title: Test Card
The [[entities]] element in 'content' wont replaced because the json sting looks like this:
{"type": "markdown", "content":"{{ \"[[entities]]\" }} "...
Then the current regex: / "\[\[entities\]\]"/gm
wont find anything. But if you put it in single quotes it will work. ;-)