comment nl2br
parent
cf61c750cd
commit
445b39b609
|
@ -280,7 +280,7 @@ ChangeDirective = ->
|
||||||
avatar: getUserAvatar(comment.user.pk)
|
avatar: getUserAvatar(comment.user.pk)
|
||||||
userFullName: getUserFullName(comment.user.pk)
|
userFullName: getUserFullName(comment.user.pk)
|
||||||
creationDate: moment(comment.created_at).format("YYYY/MM/DD HH:mm")
|
creationDate: moment(comment.created_at).format("YYYY/MM/DD HH:mm")
|
||||||
comment: comment.comment_html
|
comment: taiga.nl2br(comment.comment_html)
|
||||||
changesText: buildChangesText(comment)
|
changesText: buildChangesText(comment)
|
||||||
hasChanges: countChanges(comment) > 0
|
hasChanges: countChanges(comment) > 0
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,6 +19,10 @@
|
||||||
# File: utils.coffee
|
# File: utils.coffee
|
||||||
###
|
###
|
||||||
|
|
||||||
|
nl2br = (str) =>
|
||||||
|
breakTag = '<br />'
|
||||||
|
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2')
|
||||||
|
|
||||||
bindOnce = (scope, attr, continuation) =>
|
bindOnce = (scope, attr, continuation) =>
|
||||||
val = scope.$eval(attr)
|
val = scope.$eval(attr)
|
||||||
if val != undefined
|
if val != undefined
|
||||||
|
@ -131,6 +135,7 @@ generateHash = (components=[]) ->
|
||||||
return hex_sha1(components.join(":"))
|
return hex_sha1(components.join(":"))
|
||||||
|
|
||||||
taiga = @.taiga
|
taiga = @.taiga
|
||||||
|
taiga.nl2br = nl2br
|
||||||
taiga.bindOnce = bindOnce
|
taiga.bindOnce = bindOnce
|
||||||
taiga.mixOf = mixOf
|
taiga.mixOf = mixOf
|
||||||
taiga.trim = trim
|
taiga.trim = trim
|
||||||
|
|
Loading…
Reference in New Issue