Skip to content
Snippets Groups Projects
Commit bd6dfe7d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

respect newlines for wall messages

parent 76ffd116
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -41,6 +41,9 @@ window.linkify = (str) ->
exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig
return str.replace(exp,"<a href='$1'>$1</a>")
 
window.simpleFormat = (str) ->
linkify(sanitize(str).replace(/\n/g, '<br />'))
window.startSpinner = ->
$('.turbolink-spinner').fadeIn()
 
Loading
Loading
Loading
Loading
@@ -61,7 +61,7 @@ class Wall
template = @noteTemplate()
template = template.replace('{{author_name}}', note.author.name)
template = template.replace(/{{created_at}}/g, note.created_at)
template = template.replace('{{text}}', linkify(sanitize(note.body)))
template = template.replace('{{text}}', simpleFormat(note.body))
 
if note.attachment
file = '<i class="icon-paper-clip"/><a href="/files/note/' + note.id + '/' + note.attachment + '">' + note.attachment + '</a>'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment