Class: Marker::TextBlock

Inherits:
RecursiveList show all
Defined in:
lib/marker/text.rb

Instance Method Summary collapse

Methods inherited from RecursiveList

#r, #single?, #to_a

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#no_wrap?Boolean

returns true if this text block does not need to be wrapped in a paragraph

Returns:

  • (Boolean)


39
40
41
# File 'lib/marker/text.rb', line 39

def no_wrap?
  single? and h.no_wrap?
end

#to_html(options = {}) ⇒ Object



25
26
27
28
29
# File 'lib/marker/text.rb', line 25

def to_html( options = {} )
  to_a.map { |p|
    p.to_html(options)
  }.join(' ')
end

#to_s(options = {}) ⇒ Object

TODO: add wordwrap



32
33
34
35
36
# File 'lib/marker/text.rb', line 32

def to_s( options = {} )
  to_a.map { |p|
    p.to_s(options)
  }.join(' ')
end