about summary refs log tree commit diff stats
path: root/app/helpers
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-12 17:10:34 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-12 17:10:34 -0400
commit835af696703484208882a70cc5dd47c5838ecf58 (patch)
tree8174d5b8c6f2486da56569bad361dd10aa1183f8 /app/helpers
parentb24e6f58a525fc576e23ef9d498745e64c16cd6c (diff)
downloadthoughts-835af696703484208882a70cc5dd47c5838ecf58.tar.gz
thoughts-835af696703484208882a70cc5dd47c5838ecf58.tar.bz2
thoughts-835af696703484208882a70cc5dd47c5838ecf58.zip
Added blog post commenting
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb10
-rw-r--r--app/helpers/comments_helper.rb5
2 files changed, 13 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 861dd11..14d56cf 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb
@@ -19,9 +19,15 @@ module ApplicationHelper
19 link_to title, {:sort => col, :dir => direction}, {:class => css_class} 19 link_to title, {:sort => col, :dir => direction}, {:class => css_class}
20 end 20 end
21 21
22 def markdown(text) 22 def markdown(text, params = {})
23 options = { fenced_code_blocks: true, highlight: true } 23 options = { fenced_code_blocks: true, highlight: true }
24 Redcarpet::Markdown.new(HTML.new(), options).render(text).html_safe 24
25 html_options = {}
26 if params[:restricted]
27 html_options[:filter_html] = true
28 end
29
30 Redcarpet::Markdown.new(HTML.new(html_options), options).render(text).html_safe
25 end 31 end
26 32
27end 33end
diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 0000000..5939adc --- /dev/null +++ b/app/helpers/comments_helper.rb
@@ -0,0 +1,5 @@
1module CommentsHelper
2 def show_comments(blog)
3 render "comments/layout", blog: blog
4 end
5end