fix(preprocessor): calculate sha1 on content returned from a preprocesso...

...r

Fixes #1204 

I guess there is a better way of writing a test for this issue so all the input much appreciated. @vojtajina this was marked as high priority and I remember we've discussed this issue at one point so you might want to have a look at this PR.