Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_2_180) is shown here.
wrap(txt, line_len = 76)public
This is a higher speed (if messier) version of wrap
# File lib/rdoc/markup/to_html.rb, line 136
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.join
end Related methods
- Instance methods
- accept_blank_line
- accept_heading
- accept_list_end
- accept_list_item_end
- accept_list_item_start
- accept_list_start
- accept_paragraph
- accept_raw
- accept_rule
- accept_verbatim
- end_accepting
- gen_url
- handle_special_HYPERLINK
- handle_special_TIDYLINK
- init_tags
- start_accepting
- wrap
- Class methods
- gen_relative_url
- new
- Private methods
-
convert_heading -
convert_string -
convert_string_fancy -
convert_string_simple -
html_list_name -
list_end_for -
list_item_start