fix #747

added a test as well. reviews of the test are welcom
Merge pull request #748 from m1keil/master

fix #747
Merge branch 'master' of github.com:python-diamond/Diamond