From 4d80360bedafe69d205634d5e0699fb31d019622 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Tue, 30 Jun 2015 15:54:20 +0200
Subject: [PATCH] Cache markdown of comments

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
---
 app/views/projects/notes/_note.html.haml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index 0a77f200f56..5478a887f91 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -21,7 +21,7 @@
           - if member
             %span.note-role.label
               = member.human_access
-              
+
         - if note.system
           = link_to user_path(note.author) do
             = image_tag avatar_icon(note.author_email), class: 'avatar s16', alt: ''
@@ -56,9 +56,10 @@
 
 
       .note-body{class: note_editable?(note) ? 'js-task-list-container' : ''}
-        .note-text
-          = preserve do
-            = markdown(note.note, {no_header_anchors: true})
+        = cache [note, 'markdown'] do
+          .note-text
+            = preserve do
+              = markdown(note.note, {no_header_anchors: true})
         = render 'projects/notes/edit_form', note: note
 
       - if note.attachment.url
-- 
GitLab