lib/schnitzelpress/markdown_renderer.rb in schnitzelpress-0.1.1 vs lib/schnitzelpress/markdown_renderer.rb in schnitzelpress-0.2.0
- old
+ new
@@ -1,15 +1,15 @@
-module SchnitzelPress
+module Schnitzelpress
class MarkdownRenderer < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
def block_code(code, language)
CodeRay.highlight(code, language)
end
def image(link, title, alt_text)
oembed = OEmbed::Providers.get(link)
- %q(<div class="embedded %s">%s</div>) % [oembed.type, oembed.html]
+ %q(<div class="embedded %s %s">%s</div>) % [oembed.type, oembed.provider_name.parameterize, oembed.html]
rescue OEmbed::NotFound
%q(<img src="%s" title="%s" alt="%s"/>) % [link, escape_html(title), escape_html(alt_text)]
end
def escape_html(html)