Module: Hamdown::Engine

Defined in:
lib/hamdown/engine.rb

Overview

Main module Mahine to compile hamdown text to html

Class Method Summary collapse

Class Method Details

.perform(hd_text = '') ⇒ Object

It takes string with hamdown text and compile it to html



9
10
11
12
13
14
15
16
17
18
# File 'lib/hamdown/engine.rb', line 9

def self.perform(hd_text = '')
  return '' if hd_text.size == 0

  # step 1: hamdown to haml + html
  haml_text = MdHandler.perform(hd_text)

  # step 2: haml + html to html
  html_text = HamlHandler.perform(haml_text)
  return html_text
end