From c94cc1cef24675708ce82a093fea6411f9ec294f Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 23 Jan 2012 00:57:05 -0800 Subject: [PATCH] markdown text in comments (auto linking, etc). we can use {{{ }}} notation here because markdown strips out xss, etc. --- app/views/templates/comment.handlebars | 2 +- public/javascripts/app/views/comment_view.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/views/templates/comment.handlebars b/app/views/templates/comment.handlebars index 3ccaeb5dd..2960e55da 100644 --- a/app/views/templates/comment.handlebars +++ b/app/views/templates/comment.handlebars @@ -19,7 +19,7 @@
- {{text}} + {{{text}}}
diff --git a/public/javascripts/app/views/comment_view.js b/public/javascripts/app/views/comment_view.js index 3c97f5190..70a8a9753 100644 --- a/public/javascripts/app/views/comment_view.js +++ b/public/javascripts/app/views/comment_view.js @@ -10,14 +10,11 @@ app.views.Comment = app.views.Content.extend({ "click .comment_delete": "destroyModel" }, - initialize : function() { - $(this.el).attr("id", this.model.get("guid")); - - return this; - }, - presenter : function() { - return _.extend(this.defaultPresenter(), {ownComment: this.ownComment()}) + return _.extend(this.defaultPresenter(), { + ownComment: this.ownComment(), + text : app.helpers.textFormatter(this.model) + }) }, ownComment: function() {