Module: MarkdownMeta::Backend::Kramdown

Defined in:
lib/markdown_meta/backend/kramdown.rb

Class Method Summary collapse

Class Method Details

.to_html(content) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/markdown_meta/backend/kramdown.rb', line 7

def self.to_html(content)
  html = ::Kramdown::Document.new(content).to_html
  if content.respond_to? :encoding
    html.force_encoding content.encoding
  end
  html
end

.to_toc(content) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/markdown_meta/backend/kramdown.rb', line 15

def self.to_toc(content)
  html = ::Kramdown::Document.new(content).to_toc
  if content.respond_to? :encoding
    html.force_encoding content.encoding
  end
  html
end