Commit 7e2846fb authored by Vanja Radovanović's avatar Vanja Radovanović

using blank?, much shorter

parent 8d171a8c
...@@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator ...@@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator
# In case this first line is longer than 80 characters, it is cut off # In case this first line is longer than 80 characters, it is cut off
# after 70 characters and ellipses (`&hellp;`) are appended. # after 70 characters and ellipses (`&hellp;`) are appended.
def title def title
return no_commit_message unless safe_message && !safe_message.strip.empty? return no_commit_message if safe_message.blank?
title_end = safe_message.index(/\n/) title_end = safe_message.index(/\n/)
if (!title_end && safe_message.length > 80) || (title_end && title_end > 80) if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)
......
...@@ -11,7 +11,7 @@ module GitlabMarkdownHelper ...@@ -11,7 +11,7 @@ module GitlabMarkdownHelper
# explicitly produce the correct linking behavior (i.e. # explicitly produce the correct linking behavior (i.e.
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>"). # "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
def link_to_gfm(body, url, html_options = {}) def link_to_gfm(body, url, html_options = {})
return "" unless body && !body.strip.empty? return "" if body.blank?
gfm_body = gfm(body, html_options) gfm_body = gfm(body, html_options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment