Sha256: 8e533611fb3859acc96d9bb1cd3e00e73203af1036c1def65fda287ecc4bd65d
Contents?: true
Size: 352 Bytes
Versions: 28
Compression:
Stored size: 352 Bytes
Contents
module HoboFields class Text < String HTML_ESCAPE = { '&' => '&', '"' => '"', '>' => '>', '<' => '<' } COLUMN_TYPE = :text def to_html(xmldoctype = true) gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }.gsub("\n", "<br#{xmldoctype ? ' /' : ''}>\n") end HoboFields.register_type(:text, self) end end
Version data entries
28 entries across 28 versions & 1 rubygems