Checking options before applying syntax highlighting for HTML output

This should fix issue #906 .