diff --git a/htmlcc/parser.py b/htmlcc/parser.py
index cd11ea7..05f4f00 100644
--- a/htmlcc/parser.py
+++ b/htmlcc/parser.py
@@ -79,6 +79,13 @@ class Parser:
# {% endblock %}
self.emitter.end_block()
self.in_html = False
+ elif command.startswith('for '):
+ # {% for ... %}
+ for_defn = command[len('if '):].strip()
+ self.emitter.emit('for (' + for_defn + ') {')
+ elif command == 'endfor':
+ # {% endfor %}
+ self.emitter.emit('}')
elif command.startswith('if '):
# {% if ... %}
condition = command[len('if '):].strip()