question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add curly brace escaping feature

See original GitHub issue

Double curly braces {{ ... }} are used to inject Insomnia environment variables, but if your payload has a double curly braces pattern, the only way to send this to the upstream is by disabling rendering of the request body. However, that means you can’t use environment variables at all in this payload.

It would be nice to be able to escape Insomnia environment variables so you can use both patterns in one payload.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
develohpandacommented, Jun 1, 2021

Thanks for that @inabajunmr! Just tested it myself and it seems to work as well, although Insomnia attempts to add a pill in the UI for {{ '{{variable}}' }} and spectacularly fails. The syntax for the raw tag would be {% raw %}{{variable}}{% endraw %} which is also standard Nunjucks syntax and has special case handling in Insomnia.

image

@iinuwa I will close this issue as resolved because it does seem to work without disabling rendering entirely - anything inside the raw tags will be used raw, and other areas in the same text field can still use environment variables.

Please re-open this issue if it does not cater for your use case!

0reactions
inabajunmrcommented, May 31, 2021

The following pattern I tested works well also.

{{ '{{variable}}' }}

ref. https://github.com/mozilla/nunjucks/issues/604#issuecomment-465493535

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I print curly-brace characters in a string while using ...
If you need to include a brace character in the literal text, it can be escaped by doubling: {{ and }} . So...
Read more >
Escaping curly braces • REPL • Svelte
Interactive Svelte playground.
Read more >
How to escape curly brackets? - Zapier Community
I am creating an app which allows templating with the same syntax of merge tags as Zapier, double curly brackets.
Read more >
Escape Curly Bracket in Expression
tl;dr Is it possible to escape curly brackets ({}) when doing string manipulation in expressions? I'm trying to build an HTTP request on...
Read more >
How to put escaped curly braces inside text - Google Groups
escape sequences inside \text: \& \% \$ \# \_ \{ \}. Note that \$ is already recognized and this change would need only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found