diff options
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/core/utils/extends.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb index b812a676..950ad678 100644 --- a/lib/rbot/core/utils/extends.rb +++ b/lib/rbot/core/utils/extends.rb @@ -56,7 +56,7 @@ class ::String # stripped off and some of it converted to IRC formatting # def ircify_html - txt = self + txt = self.dup # remove scripts txt.gsub!(/<script(?:\s+[^>]*)?>.*?<\/script>/im, "") @@ -108,6 +108,14 @@ class ::String return txt.strip end + # As above, but modify the receiver + # + def ircify_html! + old_hash = self.hash + replace self.ircify_html + return self unless self.hash == old_hash + end + # This method will strip all HTML crud from the receiver # def riphtml |