lstripBlocks config strips whitespace not just from start of line

Open
#1,230 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start by tracing the withLstripBlocks configuration in Jinjava and compare its whitespace handling with the Jinja specification and the examples in this issue. Done means whitespace is stripped before a tag only when that tag begins the line, while inline tags leave preceding spaces unchanged.

Written by the indexing model from the issue text.

Description

The Jinja lstrip_blocks config is meant to strip white space preceding a tag from the start of a line.

As far as I can tell withLstripBlocks in Jinjava will currently not just strip:

hello
   {% if true %}world{% endif %}

to

hello
world

which is correct, but also strips

hello {% if true %}world{% endif %}

to

hello world

which is not according to spec.

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.