Integration of markdown with redcarpet gem
This commit is contained in:
parent
0c1ed4408f
commit
f6a9142510
3 changed files with 15 additions and 0 deletions
3
Gemfile
3
Gemfile
|
|
@ -81,6 +81,9 @@ gem 'active_model_serializers'
|
||||||
# Use FontAwesome for splash themes
|
# Use FontAwesome for splash themes
|
||||||
gem 'font-awesome-rails'
|
gem 'font-awesome-rails'
|
||||||
|
|
||||||
|
#Use Redcarpet for Markdown in description
|
||||||
|
gem 'redcarpet'
|
||||||
|
|
||||||
# Use rspec and capybara as testing framework
|
# Use rspec and capybara as testing framework
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rspec', '>= 3.0.0.beta'
|
gem 'rspec', '>= 3.0.0.beta'
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,7 @@ GEM
|
||||||
loggability (~> 0.6)
|
loggability (~> 0.6)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
yajl-ruby (~> 1.1)
|
yajl-ruby (~> 1.1)
|
||||||
|
redcarpet (3.1.2)
|
||||||
referer-parser (0.2.1)
|
referer-parser (0.2.1)
|
||||||
request_store (1.0.6)
|
request_store (1.0.6)
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
|
|
@ -413,6 +414,7 @@ DEPENDENCIES
|
||||||
rails (~> 4.1)
|
rails (~> 4.1)
|
||||||
rails-observers
|
rails-observers
|
||||||
rdoc-generator-fivefish
|
rdoc-generator-fivefish
|
||||||
|
redcarpet
|
||||||
rspec (>= 3.0.0.beta)
|
rspec (>= 3.0.0.beta)
|
||||||
rspec-rails (>= 3.0.0.beta)
|
rspec-rails (>= 3.0.0.beta)
|
||||||
rubocop
|
rubocop
|
||||||
|
|
|
||||||
|
|
@ -197,4 +197,14 @@ module ApplicationHelper
|
||||||
(short_title_brand(@conference) if @conference) ||
|
(short_title_brand(@conference) if @conference) ||
|
||||||
default_brand
|
default_brand
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dat_markdown(text)
|
||||||
|
options = {
|
||||||
|
:autolink => true,
|
||||||
|
:space_after_headers => true,
|
||||||
|
:no_intra_emphasis => true
|
||||||
|
}
|
||||||
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
|
||||||
|
markdown.render(text).html_safe
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue