diff --git a/Gemfile b/Gemfile
index 1b2e4f906..d6fa8aa3e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -56,7 +56,7 @@ gem 'groupdate' # group temporary data
gem 'browser'
gem 'turnout'
-
+gem 'redcarpet'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
diff --git a/Gemfile.lock b/Gemfile.lock
index e3088b30d..001e73c4b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -311,6 +311,7 @@ GEM
thor (>= 0.18.1, < 2.0)
raindrops (0.15.0)
rake (10.4.2)
+ redcarpet (3.3.3)
referer-parser (0.3.0)
request_store (1.2.1)
responders (2.1.0)
@@ -474,6 +475,7 @@ DEPENDENCIES
poltergeist
quiet_assets
rails (= 4.2.5)
+ redcarpet
responders
rinku
rollbar (~> 2.6.1)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 87d9ecc82..01be567d5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -21,4 +21,48 @@ module ApplicationHelper
url_for(request.query_parameters.merge(query_parameters))
end
+ def markdown(text)
+ render_options = {
+ # will remove from the output HTML tags inputted by user
+ filter_html: false,
+ # will insert
tags in paragraphs where are newlines
+ # (ignored by default)
+ hard_wrap: true,
+ # hash for extra link options, for example 'nofollow'
+ link_attributes: { }
+ # more
+ # will remove
tags from output
+ # no_images: true
+ # will remove tags from output
+ # no_links: true
+ # will remove