1. James Robert
  2. django-shpaml-template-loader

Commits

James Robert  committed b163dd8

support text enclosing django tags and update version

  • Participants
  • Parent commits 35a005f
  • Branches default

Comments (0)

Files changed (3)

File setup.py

View file
  • Ignore whitespace
 
 setup(
     name='django-shpaml-template-loader',
-    version='0.2.1',
+    version='0.2.3',
     author='Jim Robert',
     description=('A Django template loader for loading and converting '
                  'SHPAML markup to HTML'),

File shpaml_loader/shpaml.py

View file
  • Ignore whitespace
         prefix = ''
     return prefix, line
 
-@syntax('^([<{]\S.*)')
+@syntax('^([<{\(\)]\S.*)')
 def RAW_HTML(m):
     return m.group(1).rstrip()
 
     text = "{{ %s }}" % text.strip()
     return enclose_tag(tag, text)
 
+@syntax('%(.*) \| (.*)')
+def TEXT_ENCLOSING_DJANGO_TAG(m):
+    tag, text = m.groups()
+    return enclose_django_tag(tag, text)
+
 @syntax('%(.*) \|\|')
 def EMPTY_DJANGO_TAG(m):
     tag = m.groups()[0]
         RAW_HTML,
         DJANGO_VAR,
         EMPTY_DJANGO_TAG,
+        TEXT_ENCLOSING_DJANGO_TAG,
         DJANGO_TAG,
         TEXT,
         OUTER_CLOSING_TAG,

File test_project/test.suite

View file
  • Ignore whitespace
 <meta http-equiv="content-type" content="text/html;charset=utf-8">
 
 === shpaml
+%baz | woot
+---
+{% baz %}woot{% endbaz %}
+
+=== shpaml
 %baz ||
 ---
 {% baz %}{% endbaz %}