I've started using the Flask Python framework, and I'm having trouble getting indentation to work properly in the template .html
files. I use web-mode
, and it seems to really not want me to indent without opening a new html tag. For instance, this is the default indentation:
<!-- extend base layout -->
{% extends "base.html" %}
{% block content %}
<h1>Sign in</h1>
<form action="" method="post" name="login">
{{ form.hidden_tag() }}
<p>
Please enter your OpenID:<br>
{{ form.openid(size=80) }}<br>
{% for error in form.openid.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</p>
<p>{{ form.remember_me }} Remember me</p>
<p><input type="submit" value="Sign in"></p>
</form>
{% endblock %}
Ideally I would indent code within the for
loop so that I can more clearly view the structure of my code, but web-mode
won't let me Tab
that line over, no matter how many times I try. I couldn't find any other packages for Flask, but maybe I'm in the wrong place. Is there a way to get web-mode and Flask to play nicely?