Add html extension in get_output

Without this change, we can crash from trying to open directories for writing if we have a foo.md file and a foo directory, and we don't behave as expected because foo.md will cause a foo html file to be rendered with no extension.