module ExportHelper
  def markdown_text(text)
    text ||= ""
    
    renderer_options = { filter_html: true }
    markdown_extensions = { autolink: true, tables: true }

    renderer = Redcarpet::Render::HTML.new(renderer_options)
    markdown = Redcarpet::Markdown.new(renderer, markdown_extensions)
    markdown.render(text).html_safe
  end
end

module ExportHelper
  def markdown_text(text)
    text ||= ""

    renderer_options    = { filter_html: true }
    markdown_extensions = { autolink: true, tables: true, lax_spacing: true }

    renderer = Redcarpet::Render::HTML.new(renderer_options)
    markdown = Redcarpet::Markdown.new(renderer, markdown_extensions)

    markdown.render(text).html_safe
  end
end

Fix discrepencies between markdown rendered in app and email
Fix discrepencies between markdown rendered in app and email

We were sometimes running into issues where the markdown is
renered perfectly fine in the app UI but sending the email would
display parts of the markdown un-rendered.

For example, instead of showing a rendered list, it would actually
show "* item1 * item2"

The issue seems to be caused by the difference in the rendering
of spaces. Adding the `lax_spacing` extension should remove or at
least decrease the differencess in the rendering engines.
