askama icon indicating copy to clipboard operation
askama copied to clipboard

Detect duplicate blocks

Open vporton opened this issue 2 years ago • 3 comments

{% extends "_base.html" %}

{% block head %}...{% endblock %}
{% block head %}...{% endblock %}

should not compile with error message Duplicate block "head" in page ....

vporton avatar Apr 27 '22 02:04 vporton

What do you propose it should do instead?

djc avatar May 10 '22 08:05 djc

What do you propose it should do instead?

It should do a compilation error.

vporton avatar May 10 '22 08:05 vporton

Ah, your initial description had me confused since it seemed to imply to me that it was already throwing a compilation error but you thought it should not. I think this is probably reasonable... Would you be interested in submitting a PR? It shouldn't be too hard to do some error checking around https://github.com/djc/askama/blob/main/askama_shared/src/heritage.rs#L78.

djc avatar May 10 '22 08:05 djc