This option is used e.g. by the dict plugin to reduce the excessive whitespace in oxford entries.
if h and h.match(%r!<h2>#{word}(?:<sup>1</sup>)?</h2>!)\r
m.reply("#{word} : #{url}") unless justcheck\r
defn = $'\r
- m.reply("#{Bold}%s#{Bold}: %s" % [word, defn.ircify_html], :overlong => :truncate)\r
+ m.reply("#{Bold}%s#{Bold}: %s" % [word, defn.ircify_html(:nbsp => :space)], :overlong => :truncate)\r
return true\r
end\r
}\r
# 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')