class Kramdown::Parser::Kramdown
def parse_paragraph
def parse_paragraph pos = @src.pos start_line_number = @src.current_line_number result = @src.scan(PARAGRAPH_MATCH) until @src.match?(paragraph_end) result << @src.scan(PARAGRAPH_MATCH) end result.rstrip! if (last_child = @tree.children.last) && last_child.type == :p last_item_in_para = last_child.children.last if last_item_in_para && last_item_in_para.type == @text_type joiner = (extract_string((pos - 3)...pos, @src) == " \n" ? " \n" : "\n") last_item_in_para.value << joiner << result else add_text(result, last_child) end else @tree.children << new_block_el(:p, nil, nil, location: start_line_number) result.lstrip! add_text(result, @tree.children.last) end true end