class ValueList

Special rule for lists of images, styles, and scripts

Public Instance Methods

to_html(context) click to toggle source
# File lib/emerald/nodes/value_list.rb, line 9
def to_html(context)
  list_items.elements.map do |e|
    case keyword.text_value
    when 'images'  then "<img src=\"#{e.literal.to_html(context)}\"/>"
    when 'styles'  then "<link rel=\"stylesheet\" href=\"#{e.literal.to_html(context)}\"/>"
    when 'scripts' then "<script type=\"text/javascript\" src=\"#{e.literal.to_html(context)}\"></script>"
    end
  end.join("\n")
end