lib/pdfkit/pdfkit.rb in pdfkit-0.5.1 vs lib/pdfkit/pdfkit.rb in pdfkit-0.5.2
- old
+ new
@@ -85,11 +85,11 @@
found = {}
content.scan(/<meta [^>]*>/) do |meta|
if meta.match(/name=["']#{PDFKit.configuration.meta_tag_prefix}/)
name = meta.scan(/name=["']#{PDFKit.configuration.meta_tag_prefix}([^"']*)/)[0][0]
- found[name] = meta.scan(/content=["']([^"']*)/)[0][0]
+ found[name.to_sym] = meta.scan(/content=["']([^"']*)/)[0][0]
end
end
found
end
@@ -101,10 +101,10 @@
def append_stylesheets
raise ImproperSourceError.new('Stylesheets may only be added to an HTML source') if stylesheets.any? && !@source.html?
stylesheets.each do |stylesheet|
if @source.to_s.match(/<\/head>/)
- @source.to_s.gsub!(/(<\/head>)/, style_tag_for(stylesheet)+'\1')
+ @source = Source.new(@source.to_s.gsub(/(<\/head>)/, style_tag_for(stylesheet)+'\1'))
else
@source.to_s.insert(0, style_tag_for(stylesheet))
end
end
end