Commit 1f3323f9088b897220dc4989ac8da0ef71001ce1
1 parent
6c7706eb
Exists in
master
and in
4 other branches
use helper to markdown text
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -30,6 +30,10 @@ module ApplicationHelper |
30 | 30 | end |
31 | 31 | end |
32 | 32 | |
33 | + def markdown(text) | |
34 | + RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe | |
35 | + end | |
36 | + | |
33 | 37 | def search_autocomplete_source |
34 | 38 | projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } |
35 | 39 | default_nav = [ | ... | ... |
app/views/notes/_show.html.haml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | %div.note_author |
3 | 3 | = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" |
4 | 4 | %div.note_content.left |
5 | - = raw RDiscount.new(note.note, :smart, :filter_html).to_html | |
5 | + = markdown(note.note) | |
6 | 6 | - if note.attachment.url |
7 | 7 | Attachment: |
8 | 8 | = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" | ... | ... |
app/views/projects/_recent_messages.html.haml
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | %p{:style => "margin-bottom: 3px;"} |
41 | 41 | %span.author |
42 | 42 | = note.author.name |
43 | - = link_to truncate(note.note, :length => 200), link_to_item + "#note_#{note.id}" | |
43 | + = link_to truncate(markdown(note.note), :length => 200), link_to_item + "#note_#{note.id}" | |
44 | 44 | - if note.attachment.url |
45 | 45 | %br |
46 | 46 | Attachment: | ... | ... |