in lib/rdoc/markup/attribute_manager.rb [356:406]
def split_into_flow
res = []
current_attr = 0
str_len = @str.length
i = 0
i += 1 while i < str_len and @str[i].chr == "\0"
start_pos = i
while i < str_len
new_attr = @attrs[i]
if new_attr != current_attr
if i > start_pos
res << copy_string(start_pos, i)
start_pos = i
end
res << change_attribute(current_attr, new_attr)
current_attr = new_attr
if (current_attr & @attributes.regexp_handling) != 0 then
i += 1 while
i < str_len and (@attrs[i] & @attributes.regexp_handling) != 0
res << RDoc::Markup::RegexpHandling.new(current_attr,
copy_string(start_pos, i))
start_pos = i
next
end
end
begin
i += 1
end while i < str_len and @str[i].chr == "\0"
end
if start_pos < str_len
res << copy_string(start_pos, str_len)
end
res << change_attribute(current_attr, 0) if current_attr != 0
res
end