Sha256: 6120309e1de71ffc85ac867dc0d693fb67bda6ca98d389fcb4fb249a47ecd697
Contents?: true
Size: 1.11 KB
Versions: 26
Compression:
Stored size: 1.11 KB
Contents
raise "Haml not loaded" unless Haml::Engine.instance_method(:push_script) module Haml class Engine def push_script(text, flattened) unless options[:suppress_eval] push_silent("haml_temp = #{text}", true) push_silent("haml_temp = haml_temp.to_s_xss_protected", true) out = "haml_temp = _hamlout.push_script(haml_temp, #{@output_tabs}, #{flattened})\n" if @block_opened push_and_tabulate([:loud, out]) else @precompiled << out end end end def build_attributes(attributes = {}) # We ignore @options[:attr_wrapper] because ERB::Util.h does not espace ' to ' # making ' as attribute quote not workable result = attributes.map do |a,v| v = v.to_s_xss_protected unless v.blank? " #{a}=\"#{v}\"" end end result.sort.join end end class Buffer def build_attributes(attributes = {}) result = attributes.map do |a,v| v = v.to_s_xss_protected unless v.blank? " #{a}=\"#{v}\"" end end result.sort.join end end end
Version data entries
26 entries across 26 versions & 5 rubygems