From 9dfdeeaea02767336fea9d57bff5edef0c82f05a Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 4 Jun 2017 14:59:31 +0200 Subject: [PATCH] Less line feeds at the markdown output --- app/helpers/events_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 36d78bdf..71bd72ad 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -61,7 +61,11 @@ module EventsHelper tags: %w[p br h1 h2 h3 h4 table tr th td ul ol li a strong b em i sub sup], attributes: %w[href] - Kramdown::Document.new(desc, input: :html, line_width: line_width) - .to_kramdown + result = Kramdown::Document.new(desc, input: :html, line_width: line_width) + .to_kramdown + # Remove extraneous line feeds + result.gsub(/\n\n+/, ' + +').tr('\w\\', '').html_safe end end