From 788150536d9decfd09988f11f32f5e1c4d585eee Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 19 Jun 2020 21:51:08 -0400 Subject: [PATCH] Updated markdown parsing in backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - markdown parsing in backend --- app/lib/formatter.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index deb945fb..bdd802e2 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -27,6 +27,10 @@ class HTMLRenderer < Redcarpet::Render::HTML def header(text, header_level) "

#{text}

" end + + def paragraph(text) + "

#{text}

" + end def triple_emphasis(text) "#{text}" @@ -123,8 +127,9 @@ class Formatter def format_markdown(html) html = markdown_formatter.render(html) - # html.delete("\r").delete("\n") - html = html.gsub(/(?:\n\r?|\r\n?)/, '
') + html = html.gsub(/\n/, '
') + html.delete("\r").delete("\n") + html end def reformat(html, outgoing = false)