Method: XHTML#blockquote

Defined in:
lib/xhtml.rb

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



1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
# File 'lib/xhtml.rb', line 1740

def blockquote(content, options = {})
    out = ''
    opts = ['cite', 'class', 'id', 'title', 'onclick', 'ondblclick',
            'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
            'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
            'style']
    if options.nil?
        out << "<blockquote>#{content}</blockquote>\n"
    else
        out << "<blockquote"
        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}</blockquote>\n"
    end
    return out
end