hyde/hyde — Issue #104: Exception on tags with spaces
Author: theomega
Created: 2011-11-16 14:29:07+00:00
State: open

If you add tags containing spaces (like "Orange City") a exception gets thrown:

```
15:24:04 hyde.engine.Jinja2 Error parsing[blog/tags/Orange City.html]
Traceback (most recent call last):
File "/home/dominik/Development/Hyde/bin/hyde", line 9, in
load_entry_point('hyde==0.8.5a1', 'console_scripts', 'hyde')()
File "/home/dominik/Development/Hyde/src/hyde/hyde/main.py", line 10, in main
Engine().run()
File "/home/dominik/Development/Hyde/src/hyde/hyde/engine.py", line 39, in run
super(Engine, self).run(args)
File "/home/dominik/Development/Hyde/lib/python2.7/site-packages/commando.py", line 198, in run
args.run(self, args)
File "/home/dominik/Development/Hyde/src/hyde/hyde/engine.py", line 118, in gen
gen.generate_all(incremental=incremental)
File "/home/dominik/Development/Hyde/src/hyde/hyde/generator.py", line 205, in generate_all
self.__generate_node__(self.site.content, incremental)
File "/home/dominik/Development/Hyde/src/hyde/hyde/generator.py", line 303, in __generate_node__
self.__generate_resource__(resource, incremental)
File "/home/dominik/Development/Hyde/src/hyde/hyde/generator.py", line 318, in __generate_resource__
self.update_deps(resource)
File "/home/dominik/Development/Hyde/src/hyde/hyde/generator.py", line 144, in update_deps
deps.extend(self.template.get_dependencies(rel_path))
File "/home/dominik/Development/Hyde/src/hyde/hyde/ext/templates/jinja.py", line 719, in get_dependencies
ast = self.env.parse(text)
File "/home/dominik/Development/Hyde/lib/python2.7/site-packages/jinja2/environment.py", line 394, in parse
self.handle_exception(exc_info, source_hint=source)
File "", line 3, in template
jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'City'
```

This comes from a strange space in the autogenerated "Orange City.html" Tag-File (second last line):

```
$ cat Orange\ City.html
---
extends: false

---

{% set tag = site.tagger.tags['Orange City'] %}
{% set source = site.content.node_from_relative_path('blog') %}
{% set walker = source.walk_resources_tagged_with_Orange City %}
{% extends "blog_tags.j2" %}

```