Describe the bug
I am creating a new media snippet that inserts markdown. The markdown output requires square brackets ([) but the variable substitution breaks the output.
To Reproduce
Steps to reproduce the behavior:
Create a new media snippet
Insert the following code:
{"$schema":"https://frontmatter.codes/config/content.snippets.schema.json","title":"Image with caption (Markdown)","description":"Insert a responsive image with a caption (Markdown)","body":"![[[alt]]]([[&mediaUrl]] \"[[caption]]\")","isMediaSnippet":true,"fields":[]}
Open a markdown file and attempt to insert the snippet
The output fails due to the incorrect substitution on the triple bracket [[[
This is an example of the output:
!](/assets/img/en.jpg "Caption")
Expected behavior
I expect the following output:

Is there a way to escape the brackets I want to keep?
Device:
OS: Fedora 41
Front Matter CMS Version: 10.7.0
Browser: all
**Describe the bug**
I am creating a new media snippet that inserts markdown. The markdown output requires square brackets (`[`) but the variable substitution breaks the output.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a new media snippet
2. Insert the following code:
``` json
{
"$schema": "https://frontmatter.codes/config/content.snippets.schema.json",
"title": "Image with caption (Markdown)",
"description": "Insert a responsive image with a caption (Markdown)",
"body": "![[[alt]]]([[&mediaUrl]] \"[[caption]]\")",
"isMediaSnippet": true,
"fields": []
}
```
3. Open a markdown file and attempt to insert the snippet
4. The output fails due to the incorrect substitution on the triple bracket `[[[`
This is an example of the output:
```
!](/assets/img/en.jpg "Caption")
```
**Expected behavior**
I expect the following output:
```

```
Is there a way to escape the brackets I want to keep?
**Device:**
- OS: Fedora 41
- Front Matter CMS Version: 10.7.0
- Browser: all
<!-- github-sync-id:2904740057 -->
I assume you tested \[[[something]]\] to make the outer brackets literal, and it didn't work? From my understanding (low level, not the expert here) I think the outer brackets need to be somehow encoded so Front Matter is not trying to replace those.
I assume you tested `\[[[something]]\]` to make the outer brackets literal, and it didn't work? From my understanding (low level, not the expert here) I think the outer brackets need to be somehow encoded so Front Matter is not trying to replace those.
<!-- github-comment-id:2708329441 -->
Hi @scottsweb, internally, we use [[ and ]] for replacing the placeholders. You have the option to change this with the openingTags and closingTags properties.
If you change it to use curly brackets and update the body of the snippet to: "" - it should work.
Hi @scottsweb, internally, we use `[[` and `]]` for replacing the placeholders. You have the option to change this with the `openingTags` and `closingTags` properties.
```json
"<snippet title>": {
"description": "Description",
"body": [],
"fields": [],
"openingTags": "[[",
"closingTags": "]]"
}
```
If you change it to use curly brackets and update the body of the snippet to: `""` - it should work.
<!-- github-comment-id:2708345613 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
I am creating a new media snippet that inserts markdown. The markdown output requires square brackets (
[) but the variable substitution breaks the output.To Reproduce
Steps to reproduce the behavior:
[[[This is an example of the output:
Expected behavior
I expect the following output:
Is there a way to escape the brackets I want to keep?
Device:
I assume you tested
\[[[something]]\]to make the outer brackets literal, and it didn't work? From my understanding (low level, not the expert here) I think the outer brackets need to be somehow encoded so Front Matter is not trying to replace those.Hi @scottsweb, internally, we use
[[and]]for replacing the placeholders. You have the option to change this with theopeningTagsandclosingTagsproperties.If you change it to use curly brackets and update the body of the snippet to:
""- it should work.That worked perfectly @estruyf - thanks very much for the suggestions both of you. Closing.