| Conditions | 2 |
| Total Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Methods added to this helper will be available to all templates in the application. |
||
| 10 | |||
| 11 | def markdown(str) |
||
| 12 | return '' unless str |
||
| 13 | @markdown ||= Redcarpet::Markdown.new( |
||
| 14 | Redcarpet::Render::HTML.new, |
||
| 15 | autolink: true, |
||
| 16 | space_after_headers: true) |
||
| 17 | sanitize_html(close_tags(@markdown.render(str))).html_safe |
||
| 18 | end |
||
| 38 |