Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-03-14 09:24:56 +0300
committerEric Eastwood <contact@ericeastwood.com>2017-03-14 19:16:26 +0300
commit3e29936a15eb2f6c9bc2d92ebf1a67a0cadb916e (patch)
treec88bc426c4473652c0773c038b2753a8997bc30d /app/helpers
parentffcddb295950729dbc4ee7a3c0e32f7dec00da99 (diff)
Fix first line markdown helper for user profile activity stream
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/29425
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/events_helper.rb4
-rw-r--r--app/helpers/gitlab_markdown_helper.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index 5605393c0c3..fb872a13f74 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -165,8 +165,8 @@ module EventsHelper
sanitize(
text,
- tags: %w(a img b pre code p span),
- attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + ['style']
+ tags: %w(a img gl-emoji b pre code p span),
+ attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + ['style', 'data-name', 'data-unicode-version']
)
end
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 6d365ea9251..6226cfe25cf 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -172,7 +172,7 @@ module GitlabMarkdownHelper
# text hasn't already been truncated, then append "..." to the node contents
# and return true. Otherwise return false.
def truncate_if_block(node, truncated)
- if node.element? && node.description.block? && !truncated
+ if node.element? && node.description&.block? && !truncated
node.inner_html = "#{node.inner_html}..." if node.next_sibling
true
else