Browse Source

Removed debug statements. Added tests to make sure meta does not process markdown heading mark up

main
Lakshmi Vyasarajan 14 years ago
parent
commit
e65c39f6a1
2 changed files with 29 additions and 3 deletions
  1. +0
    -3
      hyde/ext/templates/jinja.py
  2. +29
    -0
      hyde/tests/ext/test_meta.py

+ 0
- 3
hyde/ext/templates/jinja.py View File

@@ -528,7 +528,6 @@ class Jinja2Template(Template):

try:
conf = attrgetter('config.jinja2')(site).to_dict()
print conf
except AttributeError:
pass

@@ -541,8 +540,6 @@ class Jinja2Template(Template):
else:
settings['extensions'].append(extensions)

print settings

self.env = Environment(
loader=self.loader,
undefined=SilentUndefined,


+ 29
- 0
hyde/tests/ext/test_meta.py View File

@@ -46,6 +46,35 @@ is_processable: False
assert not res.meta.is_processable
assert not res.is_processable

def test_ignores_pattern_in_content(self):
text = """
{% markdown %}

Heading 1
===

Heading 2
===

{% endmarkdown %}
"""
about2 = File(TEST_SITE.child('content/about2.html'))
about2.write(text)
s = Site(TEST_SITE)
s.load()
res = s.content.resource_from_path(about2.path)
assert res.is_processable

s.config.plugins = ['hyde.ext.plugins.meta.MetaPlugin']
gen = Generator(s)
gen.generate_all()
target = File(Folder(s.config.deploy_root_path).child('about2.html'))
text = target.read_all()
q = PyQuery(text)
assert q("h1").length == 2
assert q("h1:eq(0)").text().strip() == "Heading 1"
assert q("h1:eq(1)").text().strip() == "Heading 2"

def test_can_load_front_matter(self):
d = {'title': 'A nice title',
'author': 'Lakshmi Vyas',


Loading…
Cancel
Save