summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab_markdown_helper.rb
diff options
context:
space:
mode:
authoruran <uran@zeoalliance.com>2014-09-12 13:45:00 +0300
committeruran <uran@zeoalliance.com>2014-09-12 14:22:15 +0300
commit02eca79ef1e7925b85e0919cdaab8c85ff8c916a (patch)
treed10cfb50d06d03156467093e98a55156a1746818 /app/helpers/gitlab_markdown_helper.rb
parenta034a4665229425d5b3eff3082069b9ab1b57ab4 (diff)
downloadgitlab-ce-02eca79ef1e7925b85e0919cdaab8c85ff8c916a.tar.gz
Changed activity notes to display first MEANINGFUL line.
Diffstat (limited to 'app/helpers/gitlab_markdown_helper.rb')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index e4aa90154fb..d269323542f 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -51,6 +51,14 @@ module GitlabMarkdownHelper
@markdown.render(text).html_safe
end
+ def first_line_in_markdown(text)
+ line = text.split("\n").detect do |i|
+ i.present? && markdown(i).present?
+ end
+ line += '...' unless line.nil?
+ line
+ end
+
def render_wiki_content(wiki_page)
if wiki_page.format == :markdown
markdown(wiki_page.content)