Module: Ecstatic

Defined in:
lib/ecstatic.rb

Defined Under Namespace

Classes: Page

Class Method Summary collapse

Class Method Details

.mObject

escape functions



106
107
108
# File 'lib/ecstatic.rb', line 106

def markdown_to_html(str)
  Markdown.new(str, :smart).to_html
end

.markdown_to_compact_html(str) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/ecstatic.rb', line 93

def markdown_to_compact_html(str)
  res = markdown_to_html(str)
  if (res =~ /<p>.*<p>/)
    return res 
  else  # only one paragraph
    return res.gsub(/<\/?p>/,"")
  end
end

.markdown_to_html(str) ⇒ Object

escape functions



89
90
91
# File 'lib/ecstatic.rb', line 89

def markdown_to_html(str)
  Markdown.new(str, :smart).to_html
end

.markdown_to_latex(str) ⇒ Object



102
103
104
# File 'lib/ecstatic.rb', line 102

def markdown_to_latex(str)
  Markdown.new(str, :smart).to_latex
end