diff --git a/lib/cucumber/formatter/html.rb b/lib/cucumber/formatter/html.rb
index dfb6fb259c..9c15e5a528 100644
--- a/lib/cucumber/formatter/html.rb
+++ b/lib/cucumber/formatter/html.rb
@@ -311,7 +311,7 @@ def after_table_row(table_row)
@builder.tr do
@builder.td(:colspan => @col_index.to_s, :class => 'failed') do
@builder.pre do |pre|
- pre << format_exception(table_row.exception)
+ pre << h(format_exception(table_row.exception))
end
end
end