playframework / playframework/twirl
`@if` condition bring line feed in scala template
Open
Nobody has claimed this yet.
status:backlog
- Dominant language
- Scala
- Stars
- 561
- Forks
- 118
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 29
Description
Hi all,
I am facing issue with if conditions in scala template. In the following circumstance, the html will have white spaces and line breaks in between the two divs.
<div>
content in previous div.
</div>
@if(condition) {
<div>
content in next div
</div>
}
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.
Research direction
Start by reproducing the Scala template shown in the issue and inspect how Twirl handles whitespace around the @if condition. Confirm the generated HTML output and add coverage for the case; done means the conditional block does not introduce unintended spaces or line breaks between the divs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100