Class: Marker::Bulleted

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 ++



112
113
114
# File 'lib/marker/lists.rb', line 112

def phrase
  nil
end

#structureObject



103
104
105
106
107
108
109
# File 'lib/marker/lists.rb', line 103

def structure
  if phrase
    ListBuilder.new( self, :ul )
  else
    ListBuilder.new( list_item.structure, :ul )
  end
end

#to_html(options = {}) ⇒ Object



93
94
95
# File 'lib/marker/lists.rb', line 93

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

#to_s(options = {}) ⇒ Object



97
98
99
100
101
# File 'lib/marker/lists.rb', line 97

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