Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_1_378) is shown here.
wrap(txt, prefix=@indent, linelen=@width)
public
Overrides base class. Looks for ... etc sequences and generates
an array of AttrChars. This array is then used as the basis for the split.
# File lib/rdoc/ri/formatter.rb, line 289
def wrap(txt, prefix=@indent, linelen=@width)
return unless txt && !txt.empty?
txt = add_attributes_to(txt)
next_prefix = prefix.tr("^ ", " ")
linelen -= prefix.size
line = []
until txt.empty?
word = txt.next_word
if word.size + line.size > linelen
write_attribute_text(prefix, line)
prefix = next_prefix
line = []
end
line.concat(word)
end
write_attribute_text(prefix, line) if line.length > 0
end