Sha256: 03d0f72c02d86d567aaede2e31d10caed7c2594301a421db69e1fde9b3b8a7bb

Contents?: true

Size: 291 Bytes

Versions: 1

Compression:

Stored size: 291 Bytes

Contents

AutoHtml.add_filter(:big_words).with(:length => 80, :tag => "span") do |text, options|  
  text.gsub(/\w+/) do |word|
    if word.size >= options[:length]
      word.scan(/\w{1,5}/).collect { |item| "<#{options[:tag]}>#{item}</#{options[:tag]}>" }.join
    else
      word
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
galetahub-auto_html-1.0.1 lib/auto_html/filters/big_words.rb