Skip to content

Warn when content in extends child #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
softdevca opened this issue Sep 9, 2024 · 1 comment
Open

Warn when content in extends child #164

softdevca opened this issue Sep 9, 2024 · 1 comment

Comments

@softdevca
Copy link
Contributor

Top-level content is ignored in templates that extend another. Rinja should warn when this is encountered instead of silently ignoring it to reduce confusion.

This is ignored
{% extends "base.html" %}
This is also ignored
{% block content %}
    <p>Hello, world</p>
{% endblock %}
@Kijewski
Copy link
Collaborator

Kijewski commented Sep 9, 2024

Yes, I think it would be better if we make this a syntax error! But I guess is would be a breaking change, because it's a documented feature that any data outside of {% block %} is ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants