diff options
author | uran <uran@zeoalliance.com> | 2014-09-12 13:45:00 +0300 |
---|---|---|
committer | uran <uran@zeoalliance.com> | 2014-09-12 14:22:15 +0300 |
commit | 02eca79ef1e7925b85e0919cdaab8c85ff8c916a (patch) | |
tree | d10cfb50d06d03156467093e98a55156a1746818 /app/helpers/gitlab_markdown_helper.rb | |
parent | a034a4665229425d5b3eff3082069b9ab1b57ab4 (diff) | |
download | gitlab-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.rb | 8 |
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) |