Method: XHTML#strong

Defined in:
lib/xhtml.rb

#strong(content, options = {}) ⇒ Object



3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
# File 'lib/xhtml.rb', line 3280

def strong(content, options = {})
    out = '<!-- While a valid part of XHTML, it is highly recommended'
    out << " that you use CSS instead of the strong element -->\n"
    opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
            'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
            'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
    if options.nil?
        out << "<strong>#{content}</strong>\n"
    else
        out << "<strong"
        options.each do |x,y|
            x = x.to_s
            if opts.include?("#{x}")
                if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
                    z = y.join(' ')
                    out << " #{x}='#{z}'"
                else
                    out << " #{x}='#{y}'"
                end
            end
        end
        out << ">#{content}</strong>\n"
    end
    return out
end