Skip to content

Commit

Permalink
No try()
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Sep 26, 2012
1 parent 04a1418 commit 70c7ac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/html/pipeline/text_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class TextFilter < Filter
def initialize(text, context = nil, result = nil)
raise TypeError, "text cannot be HTML" if text.is_a?(DocumentFragment)
# Ensure that this is always a string
@text = text.try(:to_str) || text.to_s
@text = text.respond_to?(:to_str) ? text.to_str : text.to_s
super nil, context, result
end
end
end
end

0 comments on commit 70c7ac5

Please sign in to comment.