Permalink
Browse files

better organization and naming for new syntax highlighting support

  • Loading branch information...
1 parent 00dcf08 commit 7901685c733ef14111a1551894f2f7205b6c4649 @jess jess committed Feb 7, 2014
@@ -15,6 +15,6 @@ def post_summary_html(post)
end
def post_content_html(post)
- MarkdownService.new.render(post.content).html_safe
+ Postmarkdown::MarkdownRenderer.new.render(post.content).html_safe
end
end
@@ -1,15 +0,0 @@
-require 'rouge/plugins/redcarpet'
-
-class MarkdownService
- class HTMLWithRouge < Redcarpet::Render::HTML
- include Rouge::Plugins::Redcarpet # yep, that's it.
- end
-
- def initialize
- @markdown = ::Redcarpet::Markdown.new(HTMLWithRouge, :fenced_code_blocks => true)
- end
-
- def render(text)
- @markdown.render(text)
- end
-end
View
@@ -3,3 +3,4 @@
require 'postmarkdown/routes'
require 'postmarkdown/railtie'
require 'postmarkdown/util'
+require 'postmarkdown/markdown_renderer'
@@ -0,0 +1,18 @@
+require 'rouge/plugins/redcarpet'
+
+module Postmarkdown
+
+ class MarkdownRenderer
+ class HTMLWithRouge < Redcarpet::Render::HTML
+ include Rouge::Plugins::Redcarpet
+ end
+
+ def initialize
+ @markdown = ::Redcarpet::Markdown.new(HTMLWithRouge, :fenced_code_blocks => true)
+ end
+
+ def render(text)
+ @markdown.render(text)
+ end
+ end
+end

0 comments on commit 7901685

Please sign in to comment.