-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
I have a shell html template that other templates extend from.
In the shell template I have this:
<script type="text/javascript">
{% block js_includes %}{% endblock %}
</script>That way, I don't have to include the script tag in every template that extends from the shell.
However, when I run djhtml over those files, the javascript code is not properly indented:
{% block js_includes %}
$(document).ready(function() {
$('input:radio[name="reason"][class~="radio-ext"]').change(function (e) {
var $el = $(e.currentTarget);
$('input:radio[name="reason"]').each(function(){
if ($el.attr('id') != $(this).attr('id')) {
$(this).next().next().addClass('hide');
} else {
$(this).next().next().toggleClass('hide');
}
});
});
})
{% endblock %}It is properly indented if I add surrounding script tags:
{% block js_includes %}
<script type="text/javascript">
$(document).ready(function() {
$('input:radio[name="reason"][class~="radio-ext"]').change(function (e) {
var $el = $(e.currentTarget);
$('input:radio[name="reason"]').each(function(){
if ($el.attr('id') != $(this).attr('id')) {
$(this).next().next().addClass('hide');
} else {
$(this).next().next().toggleClass('hide');
}
});
});
})
</script>
{% endblock %}How could we fix/workaround this? Can the script tag not be mandatory to properly indent js?
Metadata
Metadata
Assignees
Labels
No labels