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 @tree.children.last && @tree.children.last.type == :p last_item_in_para = @tree.children.last.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, @tree.children.last) 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