Class: MinimalMarkdown::Nodes::Text

Inherits:
Struct
  • Object
show all
Defined in:
lib/minimal_markdown/nodes/text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



4
5
6
# File 'lib/minimal_markdown/nodes/text.rb', line 4

def text
  @text
end

Instance Method Details

#render(output) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/minimal_markdown/nodes/text.rb', line 5

def render(output)
  if text.is_a?(Array)
    text.each { |child| child.render(output) }
  else
    output << CGI.escapeHTML(text)
  end
end