Initial commit
This commit is contained in:
21
lib/adamantium/renderer/markdown.rb
Normal file
21
lib/adamantium/renderer/markdown.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require "redcarpet"
|
||||
|
||||
module Adamantium
|
||||
module Renderer
|
||||
class Markdown
|
||||
attr_accessor :markdown
|
||||
|
||||
def initialize
|
||||
renderer = Redcarpet::Render::HTML.new({})
|
||||
extensions = {
|
||||
fenced_code_blocks: true
|
||||
}
|
||||
@markdown = Redcarpet::Markdown.new(renderer, extensions)
|
||||
end
|
||||
|
||||
def call(content:)
|
||||
markdown.render(content)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user