about summary refs log tree commit diff stats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 97a897f..a51f1a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb
@@ -1,6 +1,7 @@
1require 'redcarpet' 1require 'redcarpet'
2require 'rouge' 2require 'rouge'
3require 'rouge/plugins/redcarpet' 3require 'rouge/plugins/redcarpet'
4require 'redcarpet/render_strip'
4 5
5module ApplicationHelper 6module ApplicationHelper
6 7
@@ -45,4 +46,14 @@ module ApplicationHelper
45 ] 46 ]
46 end 47 end
47 48
49 class StrippedSummary < Redcarpet::Render::StripDown
50 def block_html(raw_html)
51 nil
52 end
53 end
54
55 def stripped_markdown(text)
56 Redcarpet::Markdown.new(StrippedSummary).render(text)
57 end
58
48end 59end