lib/roadie/inliner.rb
# Regexp matching all the url() declarations in CSS
#
# It matches without any quotes and with both single and double quotes
# inside the parenthesis. There's much room for improvement, of course.
Regexp matching all the url() declarations in CSS
It matches without any quotes and with both single and double quotes
inside the parenthesis. There's much room for improvement, of course.
Regexp matching all the url () declarations in CSS It matches without any quotes and with both single and double quotes inside the parenthesis . There ' s much room for improvement of course .
def inline_css_rules
        elements_with_declarations.each do |element, declarations|
          ordered_declarations = []
          seen_properties = Set.new
          declarations.sort.reverse_each do |declaration|
            next if seen_properties.include?(declaration.property)
            ordered_declarations.unshift(declaration)
            seen_properties << declaration.property
          end
          rules_string = ordered_declarations.map { |declaration| declaration.to_s }.join(';')
          element['style'] = [rules_string, element['style']].compact.join(';')
        end
      end
def inline_css_rules elements_with_declarations . each do | element , declarations | ordered_declarations = [ ] seen_properties = Set . new declarations . sort . reverse_each do | declaration | next if seen_properties . include? ( declaration . property ) ordered_declarations . unshift ( declaration ) seen_properties << declaration . property end rules_string = ordered_declarations . map { | declaration | declaration . to_s } . join ( ';' ) element [ 'style' ] = [ rules_string , element [ 'style' ] ] . compact . join ( ';' ) end end
Regexp matching all the url() declarations in CSS
It matches without any quotes and with both single and double quotes
inside the parenthesis.
Regexp matching all the url () declarations in CSS It matches without any quotes and with both single and double quotes inside the parenthesis .