Skip to content

Commit

Permalink
Finish getting the PDF formatter to support songkick's features, fixi…
Browse files Browse the repository at this point in the history
…ng HTML escaping issues
mattwynne committed Jan 21, 2010
1 parent 739cd37 commit 670fd16
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/cucumber/formatter/console.rb
Original file line number Diff line number Diff line change
@@ -145,9 +145,11 @@ def announce(announcement)
if @delayed_announcements
@delayed_announcements << announcement
else
@io.puts
@io.puts(format_string(announcement, :tag))
@io.flush
if @io
@io.puts
@io.puts(format_string(announcement, :tag))
@io.flush
end
end
end

4 changes: 2 additions & 2 deletions lib/cucumber/formatter/pdf.rb
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ def step_result(keyword, step_match, multiline_arg, status, exception, source_in

def step_name(keyword, step_match, status, source_indent, background)
return if @hide_this_step
line = "<b>#{keyword}</b> #{step_match.format_args("%s").gsub('<', '&lt;').gsub('>', '&gt;')}"
line = "<b>#{keyword}</b> #{encode(step_match.format_args("%s"))}"
colorize(line, status)
end

@@ -207,7 +207,7 @@ def encode(text)
def colorize(text, status)
keep_with do
@doc.fill_color(@status_colors[status] || BLACK)
@doc.text(encode(text))
@doc.text(text)
@doc.fill_color(BLACK)
end
end

0 comments on commit 670fd16

Please sign in to comment.