Unexpected behavior of context.getTemplateName()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 461
- PR merge metrics
- No merged PRs in 30d
Description
Consider a template named `a.html`;
~~~~
Some literals
// inside a helper calling context.getTemplateName() results in 'a.html'
{> "b.html" /}
Some more literals
// inside a helper calling context.getTemplateName() now results in 'b.html'
~~~~
I think invoking context.getTemplateName() should always return the name of the template that is currently rendered, i.e. `a.html` in all cases shown above and `b.html` when invoked inside `b.html'.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by reproducing the example with a.html, the helper calling context.getTemplateName(), and the included b.html template. Inspect how getTemplateName tracks the current render context; done means it consistently returns a.html from the helper in this case and b.html when called within b.html.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100