diff options
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/core/utils/extends.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb index dcc257a2..4e5459d8 100644 --- a/lib/rbot/core/utils/extends.rb +++ b/lib/rbot/core/utils/extends.rb @@ -144,6 +144,14 @@ class ::String # such as txt = Utils.decode_html_entities(txt) + # Keep unbreakable spaces or conver them to plain spaces? + case val = opts[:nbsp] + when :space, ' ' + txt.gsub!([160].pack('U'), ' ') + else + warning "unknown :nbsp option #{val} passed to ircify_html" if val + end + # Remove double formatting options, since they only waste bytes txt.gsub!(/#{Bold}(\s*)#{Bold}/, '\1') txt.gsub!(/#{Underline}(\s*)#{Underline}/, '\1') |