Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Is there a way to not render a variable that is not defined?

Open
#1,001 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start by reproducing the template examples in the issue and compare rendering when name is defined versus undefined. Done means an undefined variable remains visible as {{ name }} without requiring the default filter, while the defined case still renders John Doe.

Written by the indexing model from the issue text.

Description

For instance given the following template:
Hi my name is {{ name }}

If name is defined as "John Doe" the result would be Hi my name is John Doe
But if name is undefined would render as Hi my name is {{ name }}
Currently it renders as Hi my name is

I would like to accomplish this without something like {{ name|default "{{ name }}" }}

Dominant language
Java
Stars
785
Forks
184
Avg merge
6d 22h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/jinjava

All issues in HubSpot/jinjava

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.