{% include %} template tags do not work with non-VALID_EXTENSIONS
I tend to embed inline javascript snippets by using {% include %} django template tags like this:
-# template.haml
!!! 5
%html
%body
%p hello world
%script
{% autoescape off %}
{% include "path/to/file.js" %}
{% endautoescape %}
This is convenient because my editor can then use the appropriate javascript syntax highlighting rather than the haml syntax highlighting. The problem is that this produces a RuntimeError (maximum recursion dept exceeded while calling a Python object) for any templates that are {% include %}-ed but do not end in one of the hamlpy.VALID_EXTENSIONS. Bummer.
I might recommend making VALID_EXTENSIONS a settings variable within the hamlpy app that can easily be extended in the site settings.py.
+1
I took a stab at incorporating this in a manner similar to how HAMLPY_ATTR_WRAPPER is written. I didn't see any tests for HAMLPY_ATTR_WRAPPER so I wasn't sure the best way to add tests for this new functionality. If you have any suggestions, etc, I'm happy to modify accordingly.