Class: Marker::Indented

Inherits:
ParseNode show all
Defined in:
lib/marker/lists.rb

Instance Method Summary collapse

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#phraseObject

– defaults ++



162
163
164
# File 'lib/marker/lists.rb', line 162

def phrase
  nil
end

#structureObject



153
154
155
156
157
158
159
# File 'lib/marker/lists.rb', line 153

def structure
  if phrase
    ListBuilder.new( self, :div, :class => 'indent' )
  else
    ListBuilder.new( list_item.structure, :div, :class => 'indent' )
  end
end

#to_html(options = {}) ⇒ Object



143
144
145
# File 'lib/marker/lists.rb', line 143

def to_html( options = {} )
  "<div>#{phrase.to_html(options)}</div>"
end

#to_s(options = {}) ⇒ Object



147
148
149
150
151
# File 'lib/marker/lists.rb', line 147

def to_s( options = {} )
  indent = (options[:indent] || 0)
  '    ' * (indent > 0 ? indent : 0) +
  phrase.to_s(options)
end