def read_indented_content(src, indentation, break_list, item_type)
lines =[]
saw_empty = false; saw_anything_after = false
while src.cur_line
if src.cur_line.md_type == :empty
saw_empty = true
lines << src.shift_line
next
end
if saw_empty
if (ns=number_of_leading_spaces(src.cur_line)) < indentation
break
end
saw_anything_after = true
else
break if break_list.include? src.cur_line.md_type
end
stripped = strip_indent(src.shift_line, indentation)
lines << stripped
if stripped.md_type == :text
while src.cur_line && (src.cur_line.md_type == :text)
lines << strip_indent(src.shift_line, indentation)
end
end
end
want_my_paragraph = saw_anything_after ||
(saw_empty && (src.cur_line && (src.cur_line.md_type == item_type)))
while lines.last && (lines.last.md_type == :empty)
lines.pop
end
return lines, want_my_paragraph
end