Class: Redcarpet::Render::StripDown

Inherits:
Base
  • Object
show all
Defined in:
lib/redcarpet/render_strip.rb

Overview

Markdown-stripping renderer. Turns Markdown into plaintext Thanks to @toupeira (Markus Koller)

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Redcarpet::Render::Base

Instance Method Details

#header(text, header_level) ⇒ Object



43
44
45
# File 'lib/redcarpet/render_strip.rb', line 43

def header(text, header_level)
  text + "\n"
end

#image(link, title, content) ⇒ Object



34
35
36
37
# File 'lib/redcarpet/render_strip.rb', line 34

def image(link, title, content)
  content &&= content + " "
  "#{content}#{link}"
end

Other methods where we don’t return only a specific argument



30
31
32
# File 'lib/redcarpet/render_strip.rb', line 30

def link(link, title, content)
  "#{content} (#{link})"
end

#paragraph(text) ⇒ Object



39
40
41
# File 'lib/redcarpet/render_strip.rb', line 39

def paragraph(text)
  text + "\n"
end

#table(header, body) ⇒ Object



47
48
49
# File 'lib/redcarpet/render_strip.rb', line 47

def table(header, body)
  "#{header}#{body}"
end

#table_cell(content, alignment) ⇒ Object



55
56
57
# File 'lib/redcarpet/render_strip.rb', line 55

def table_cell(content, alignment)
  content + "\t"
end

#table_row(content) ⇒ Object



51
52
53
# File 'lib/redcarpet/render_strip.rb', line 51

def table_row(content)
  content + "\n"
end