Merge pull request #1424 from elvanja/issue-1343-empty-string-fix

FIX: Empty string in commit message
This commit is contained in:
Dmitriy Zaporozhets 2012-09-11 00:08:51 -07:00
commit 1c08cb404d
2 changed files with 3 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator
# In case this first line is longer than 80 characters, it is cut off
# after 70 characters and ellipses (`&hellp;`) are appended.
def title
return no_commit_message unless safe_message
return no_commit_message if safe_message.blank?
title_end = safe_message.index(/\n/)
if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)

View file

@ -11,6 +11,8 @@ module GitlabMarkdownHelper
# explicitly produce the correct linking behavior (i.e.
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
def link_to_gfm(body, url, html_options = {})
return "" if body.blank?
gfm_body = gfm(body, html_options)
gfm_body.gsub!(%r{<a.*?>.*?</a>}m) do |match|