%></div>" def description_html Kramdown::Document.new( process_pasted_content, template: MARKDOWN_TEMPLATE, ).to_html end private HEADER_MATCH = /\n\n([A-Z &]+:)\n/ HEADER_MARKDOWN = "\n\n\\1\n\n".freeze LIST_MATCH = /\n(?:•|\*)/ LIST_MARKDOWN = "\n* ".freeze def process_pasted_content description.to_s. gsub(HEADER_MATCH, HEADER_MARKDOWN). gsub(LIST_MATCH, LIST_MARKDOWN) end end 22