class Infoboxer::Tree::Pre

Represents preformatted text chunk.

Paragraph-level thing, can contain many lines of text.

Public Instance Methods

merge!(other) click to toggle source

@private Internal, used by {Parser}

Calls superclass method Infoboxer::Tree::Mergeable#merge!
# File lib/infoboxer/tree/paragraphs.rb, line 112
def merge!(other)
  if other.is_a?(EmptyParagraph) && !other.text.empty?
    @children.last.raw_text << "\n" << other.text.sub(/^ /, '')
  else
    super
  end
end
splitter() click to toggle source

@private Internal, used by {Parser} for merging

# File lib/infoboxer/tree/paragraphs.rb, line 122
def splitter
  Text.new("\n")
end