Include does not evaluate path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start at src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java around line 68 and trace how the include path is obtained from the tag tokens. Reproduce both concatenation examples and verify that the resolved path is path/to/file.jinja, matching the Python library's behavior; add or update the relevant tests if the repository identifies them.
Written by the indexing model from the issue text.
Description
The path for include tag (and possibly other tags) is not evaluated properly if it consists of string concatenations.
For the following example:
{% include "path" ~ "/to" ~ "/file.jinja" %}
the Include and Exclude Tag end up trying to include the file path instead of the expected path/to/file.jinja.
This is possibly due to IncludeTag.java:68 where the path is determined by only the first token.
Moreover, when we try to "game" the tokenizing process by removing spaces like so:
{% include "path"~"/to"~"/file.jinja" %}
The tags will try to interpret the path path"~"/to"~"/file.jinja without evaluation.
The expected behaviour would be for the path to be evaluated in both examples, as that's what happens using the python library.
- Dominant language
- Java
- Stars
- 785
- Forks
- 184
- Avg merge
- 6d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HubSpot/jinjava
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Jinjava 3.0 Open
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100