Permalink
Browse files

Removed the need for ternaries by using threequals.

  • Loading branch information...
1 parent d63c861 commit 5e9dd0b16945b421146a3c54eb75c9904b872f67 @parndt committed Apr 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/truncate_html/html_string.rb
@@ -21,11 +21,11 @@ def html_tokens
end
def html_tag?
- self =~ /<\/?[^>]+>/ ? true : false
+ /<\/?[^>]+>/ === self
end
def open_tag?
- self =~ /<(?!(?:#{UNPAIRED_TAGS.join('|')}|script|\/))[^>]+>/i ? true : false
+ /<(?!(?:#{UNPAIRED_TAGS.join('|')}|script|\/))[^>]+>/i === self
end
def matching_close_tag

0 comments on commit 5e9dd0b

Please sign in to comment.