deezer / deezer/template-remover

Jinja temlate cleaner should be smarter

Open
#1 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Current Jinja cleaner implementation is not very smart, it just replaces
all tamplate tags to speces.

But I thing it should be smarter and detect places where tags should be
completely removed and where replaced to something.

My suggestions:

**Remove whole line if tag takes whole line.**

For example this:

``` html
1
{% if true %}
2
{% endif %}">
3
{% block name %}
4
{% endblock %}">
5
```

Should output:

``` html
1
2
3
4
5
```

**Remove inline tags completely.**

For example this:

``` html


```

Should be replaced to this:

``` html


```

But of course, this should depend on tag, for example, `{% trans "" %}` should
always be replace to some content.

What do you think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.