sjl/d — Issue #3: Page without title causes a stack trace
Author: kisielk
Created: 2012-01-31 19:28:49+00:00
State: open

Say you make a file called `foo.markdown` and don't put a level one heading, the program crashes with:

```Traceback (most recent call last):
File "/Network/Cluster/home/kamil/.virtualenvs/docs/bin/d", line 13, in
main()
File "/Network/Cluster/home/kamil/.virtualenvs/docs/lib/python2.6/site-packages/d/base.py", line 215, in main
render_files()
File "/Network/Cluster/home/kamil/.virtualenvs/docs/lib/python2.6/site-packages/d/base.py", line 203, in render_files
chapter_title = render_chapter(title, footer, filename)
File "/Network/Cluster/home/kamil/.virtualenvs/docs/lib/python2.6/site-packages/d/base.py", line 174, in render_chapter
return _render(title, footer, path, target, 'content')
File "/Network/Cluster/home/kamil/.virtualenvs/docs/lib/python2.6/site-packages/d/base.py", line 161, in _render
content = _linkify_title(_fix_md_toc(content))
File "/Network/Cluster/home/kamil/.virtualenvs/docs/lib/python2.6/site-packages/d/base.py", line 127, in _linkify_title
e('.markdown h1').html('' + title + '')
TypeError: cannot concatenate 'str' and 'NoneType' objects
```