Fix capture_html so it doesn't call the block after it's called inside slim handler
Add tests for #1177