 
   trim_commit_url = (url) ->
     url.replace(/(\/[0-9a-f]{9})[0-9a-f]+$/, '$1')
+
+  strip_content = (str) ->
+    str.split(/\n/).filter (line, index) ->
+      # Remove the \n first so we have content only
+      if line.length != 0
+          line
+    .filter (_line, _index) ->
+      if _index <= 4
+        _line
+    .join("\n")
 
   handler = (type, req, res) ->
     query = querystring.parse(url.parse(req.url).query)

                text = "Issue #{bold(hook.object_attributes.iid)}: #{hook.object_attributes.title} (#{hook.object_attributes.action}) at #{hook.object_attributes.url}"
                if hook.object_attributes.description
                  # split describtion on \r\n so that It can add >> to every line
                  splitted = hook.object_attributes.description.split  "\r\n"
                  for i in [0...splitted.length]
                    splitted[i] = ">> " + splitted[i]
                  text += "\r\n" + splitted.join "\r\n"
                robot.send user, text
            when "merge_request"
              unless hook.object_attributes.action == "update"
                if showMergeDesc == "1"  
                  text = "Merge Request #{bold(hook.object_attributes.iid)}: #{hook.user.username} #{hook.object_attributes.action}  #{hook.object_attributes.title} between #{bold(hook.object_attributes.source_branch)} and #{bold(hook.object_attributes.target_branch)} at #{bold(hook.object_attributes.url)}\n"
                  splitted = hook.object_attributes.description.split  "\r\n"
                  for i in [0...splitted.length]
                    splitted[i] = "> " + splitted[i]
                  text += "\r\n" + splitted.join "\r\n"
                  robot.send user, text
                else
                  robot.send user, "Merge Request #{bold(hook.object_attributes.iid)}: #{hook.user.username} #{hook.object_attributes.action}  #{hook.object_attributes.title} (#{hook.object_attributes.state}) between #{bold(hook.object_attributes.source_branch)} and #{bold(hook.object_attributes.target_branch)} at #{bold(hook.object_attributes.url)}"

  robot.router.post "/gitlab/system", (req, res) ->
    handler "system", req, res

    robot.http(GITLAB_URL+"/api/v3/projects/"+project_id+"/trigger/builds")
        .header('Content-Type', 'application/json')
        .post(data) (err, res, body) ->
          # your code here
