Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.
wrap(txt, line_len = 76)public
This is a higher speed (if messier) version of wrap
# File lib/rdoc/markup/simple_markup/to_latex.rb, line 149
def wrap(txt, line_len = 76)
res = ""
sp = 0
ep = txt.length
while sp < ep
# scan back for a space
p = sp + line_len - 1
if p >= ep
p = ep
else
while p > sp and txt[p] != ?\s
p -= 1
end
if p <= sp
p = sp + line_len
while p < ep and txt[p] != ?\s
p += 1
end
end
end
res << txt[sp...p] << "\n"
sp = p
sp += 1 while sp < ep and txt[sp] == ?\s
end
res
end Related methods
- Instance methods
- accept_blank_line
- accept_heading
- accept_list_end
- accept_list_item
- accept_list_start
- accept_paragraph
- accept_rule
- accept_verbatim
- add_tag
- end_accepting
- escape
- init_tags
- l
- start_accepting
- wrap
- Class methods
- l
- new
- Private methods
-
convert_flow -
convert_heading -
convert_special -
convert_string -
list_end_for -
list_item_start -
list_name -
off_tags -
on_tags